We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Imported from Lighthouse. Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/6673 Created by Andriy Tyurnikov - 2011-04-05 10:41:54 UTC
class Poll < ActiveRecord::Base has_many :answers
validates_associated :answers
accepts_nested_attributes_for :answers, :allow_destroy => true end
class Answer < ActiveRecord::Base belongs_to :poll
validates_uniqueness_of :body, :scope => :poll_id end
When new poll is created, attributes for associated answers are passed, but uniqueness of answers body in scope of poll is not validated.
Any ideas how to fix that.
The text was updated successfully, but these errors were encountered:
Imported from Lighthouse. Comment by Kane - 2011-04-05 23:38:33 UTC
can you supply a failing test case?
Sorry, something went wrong.
No branches or pull requests
Imported from Lighthouse. Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/6673
Created by Andriy Tyurnikov - 2011-04-05 10:41:54 UTC
class Poll < ActiveRecord::Base
has_many :answers
validates_associated :answers
accepts_nested_attributes_for :answers, :allow_destroy => true
end
class Answer < ActiveRecord::Base
belongs_to :poll
validates_uniqueness_of :body, :scope => :poll_id
end
When new poll is created,
attributes for associated answers are passed,
but uniqueness of answers body in scope of poll is not validated.
Any ideas how to fix that.
The text was updated successfully, but these errors were encountered: