mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Disable validations for associated belongs_to record by default
This commit is contained in:
parent
7f140bbdda
commit
71bf756ea2
2 changed files with 3 additions and 3 deletions
|
@ -940,7 +940,7 @@ module ActiveRecord
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
add_single_associated_save_callbacks(reflection.name) unless options[:validate] == false
|
add_single_associated_save_callbacks(reflection.name) if options[:validate] == true
|
||||||
|
|
||||||
configure_dependency_for_belongs_to(reflection)
|
configure_dependency_for_belongs_to(reflection)
|
||||||
end
|
end
|
||||||
|
|
|
@ -56,8 +56,8 @@ class Developer < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
class AuditLog < ActiveRecord::Base
|
class AuditLog < ActiveRecord::Base
|
||||||
belongs_to :developer
|
belongs_to :developer, :validate => true
|
||||||
belongs_to :unvalidated_developer, :class_name => 'Developer', :validate => false
|
belongs_to :unvalidated_developer, :class_name => 'Developer'
|
||||||
end
|
end
|
||||||
|
|
||||||
DeveloperSalary = Struct.new(:amount)
|
DeveloperSalary = Struct.new(:amount)
|
||||||
|
|
Loading…
Reference in a new issue