similar to: Bug in validates_associated?

Displaying 20 results from an estimated 600 matches similar to: "Bug in validates_associated?"

2012 Apr 04
1
sambaHomePath usage
My name is Camelia Botez and I'm linux system admin. I try to configure samba server usind ldap authentication and different sambaHomePath from login home directory. For ex. A user user_test has his home (login) directory /home/user_test and I want , using samba map on windows to have /srv/user_test home directory for this user. We included in ldap schema 2 attributes sambaHomeDrive (H: ) And
2006 Mar 13
3
validates_associated problem
Hello, I have a situation where an ''employee'' belongs to a ''department'' and have setup the relationship as follows. class Employee < ActiveRecord::Base belongs_to :department, :foregin_key => "department_id" validates_associated :department_id end class Department < ActiveRecord::Base has_many :employees def validate_on_update
2006 Mar 18
1
has_many and validates_associated
By trial and error I seem to arrive to the conclusion that 1. Validation recurses through has_many by default and a root save! call raises an excepcion if some child no matter how nested is fails validation 2. Validation does not recurse through has_one by default and you can change this with validates_associated, in which case exceptions behave like above
2006 Jun 13
6
Dead horse: validates_associated
Regarding validates_associated... Let''s say I have: article belongs_to author But for whatever reason, I want an article to also be written anonymously and therefore not require an author. Then I have: Article: belongs_to :author validates_associated :author But I DON''T have validates_presence_of. What I want to do is validate that an author is valid --if it is
2008 Jun 29
2
How to write test about validates_associated
Here is my model: class Account < ActiveRecord::Base has_many :users, :dependent => :destroy has_many :bus belongs_to :currency has_many :mylogs, :dependent => :destroy has_many :batchuserdefines, :dependent => :destroy has_many :materialuserdefines, :dependent => :destroy has_many :materials has_many :inventories has_many :batchs has_many :courses has_many
2005 Oct 26
2
validates_associated ... doesn't
Hi, I think I''m missing some fundamental information here so hopefully someone can help me. I have a model Club which has many members, members of course belong to a Club. I''d like to ensure that when a members is saved (saved/created/updated) only valid club_id''s are accepted. I have a Club model (simplified) like this: class Club < ActiveRecord::Base
2006 Oct 14
2
issues with validates_associated not throwing error
Hello all I''m having an issue with ruby on rails, and it not throwing an error where it should. I have a class ''clientpool'' that is: class Clientpool < ActiveRecord::Base set_table_name "clientpool" set_primary_key "id" belongs_to :clients, :foreign_key => "cliname" validates_presence_of :cliname validates_associated :client end
2013 Feb 13
3
conditional validates_associated
Hello, Have you guys noticed that conditional validation with validates_associated does not work well when you are creating a new record? Consider this gist: https://gist.github.com/aflag/4780225 The Lawyer class has validates_associated on address conditioned on whether the Lawyer data comes from a known source or not. So, if lawyer.source equals to some string, then lawyer.address must
2008 Nov 20
1
running tests on gem
Is there a way to run he tests with cjust the gem installed? I wanted to run the tests on the gem and tried: $ jruby -S gem list RedCloth *** LOCAL GEMS *** RedCloth (4.1.1) $ jruby --version jruby 1.1.5 (ruby 1.8.6 patchlevel 114) (2008-11-14 rev 6586) [i386-java] [jruby.git (master)]$ jruby -S gem check -test RedCloth ERROR: While executing gem ... (OptionParser::InvalidOption)
2008 Jul 01
6
validates_associated & foreign keys
Hi, I''m struggling to get the validates_associated to work as I think it should be. I''m using: JRuby 1.1 rails-2.0.2 activerecord-2.0.2 activerecord-jdbc-adapter-0.8.2 My tables in MySQL: CREATE TABLE area_codes ( id INT UNSIGNED auto_increment primary key ... ); CREATE TABLE markets ( id INT UNSIGNED auto_increment primary key, ... ); CREATE TABLE
2006 Apr 13
3
Salted Hash Login Generator problem
Im trying to install salted and get errors when running the rake test... /usr/bin/ruby1.8 -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake/rake_test_loader .rb" "test/unit/localization_test.rb" "test/unit/user_test.rb" Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake/rake_test_loader Started ........F....E Finished in 0.108794 seconds. 1)
2009 Oct 27
5
Unwanted call to validates_associated
In my schema, a question has_many :answers. When the validations are run on a question, and one of the answers is not valid, then i get "Answers is not valid" coming out of errors.full_messages. I don''t want this, i''m already testing the validity of the answers and this is an ugly and uninformative error message. It looks like it''s the message i would get
2006 Aug 17
2
validates_associated bug?
i seem to be experiencing a bug where rails tells me that my organization object''s associated credit card is invalid (activerecord validation-wise invalid), when i know it to be valid. this happens only if i tell the organization to validate_associated :credit_card. i know the associated credit card is valid, because a) that credit_card object itself throws no validation errors, and b)
2008 Mar 11
1
add_multiple_associated_save_callbacks and validates_associated conflict?
Perhaps I''m misunderstanding what''s happening here, but I''m having a problem with not being able to disable the validation of an associated collection if that collection contains a new record. Example... class Person < ActiveRecord::Base has_many :email_addresses validates_associated :email_addresses, :if => Proc.new { false } end p = Person.new
2004 Nov 03
5
FireFly Problems
How come FireFly doesn't give me an Inband DTMF option? Only RFC2833 and Info. RFC2833 is the default, so I left it that way. I also unchecked all the codecs except g711ulaw to force that codecs usage. However, when I go to place a call, I get this: Nov 3 13:18:44 WARNING[53641241]: dsp.c:1468 ast_dsp_process: Inband DTMF is not supported on codec G.711 u-law. Use RFC2833 Nov 3 13:18:44
2009 Apr 10
1
ActiveRecord question
Hello there, newbie speaking Let''s say I have: class Office has_many :holidays #(just a list of dates when the office is closed) has_many :doctors #doctors who work in the office end class Doctor belongs_to :office has_many :holidays #(additional dates when this doctor is not available) end class Holiday (has a office_id, doctor_id and a date field) end From the app standpoint I
2006 Jun 08
1
Test errors
I''m working on learning user auth and ran a test/unit/test.rb and seem to have stumbled across some errors. This is from a tutorial on the web and I pretty much copied the code and checked syntax so not sure where it''s wrong. I thought I''d throw it out since I"m new to ROR and the error didn''t look too bad ;), perhaps someone would have a better
2006 Jun 23
1
''Series'' Pluralization
Howdy, I have a model I called ''content_series''. I created it and noticed that Rails called it ''Sery'', so I added ''series'' to the uncountable thing in the config, like this: Inflector.inflections do |inflect| # inflect.plural /^(ox)$/i, ''\1en'' # inflect.singular /^(ox)en/i, ''\1'' #
2006 May 02
2
Autotest doesn''t work on WinXP?
When I try to run autotest (zenspider) (which looks VERY cool), I get this error: (run from within a Rails app directory) C:\ruby_home\analysis>autotest -rails # Testing updated files + c:/ruby/bin/ruby -Ilib:test -e ''["test/unit/user_test.rb", "test/unit/role_test.rb"].each { |f| load f }'' | unit_diff -u ''c:'' is not recognized
2006 May 04
2
Testing associations
I have a pretty simple model, articles and users. class Article belongs_to :user end class User has_many :articles end In my unit tests I want to ensure that the associations work properly. What''s the best way to do this? The obvious thing to do is a test in each model. # user_test.rb def test_add_post u = users(:first) before_articles = u.articles.count u.articles