diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2015-10-26 16:05:16 -0600 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-10-26 16:05:16 -0600 |
commit | 118232aef4094ce0a1dfbb827b672509e7c33542 (patch) | |
tree | b7c4623ade1deae4755b3ce729b780c2270afa47 /activerecord/test/models | |
parent | 2794de05d6b7d5c2a8dd00dc69b585b3e45c4bc1 (diff) | |
parent | 21e448b5a5ab4dec6fd129f4eaba971d46a12bb1 (diff) | |
download | rails-118232aef4094ce0a1dfbb827b672509e7c33542.tar.gz rails-118232aef4094ce0a1dfbb827b672509e7c33542.tar.bz2 rails-118232aef4094ce0a1dfbb827b672509e7c33542.zip |
Merge pull request #19686 from tsun1215/index_errors
Errors can be indexed with nested attributes
Close #8638
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/guitar.rb | 4 | ||||
-rw-r--r-- | activerecord/test/models/tuning_peg.rb | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/models/guitar.rb b/activerecord/test/models/guitar.rb new file mode 100644 index 0000000000..cd068ff53d --- /dev/null +++ b/activerecord/test/models/guitar.rb @@ -0,0 +1,4 @@ +class Guitar < ActiveRecord::Base + has_many :tuning_pegs, index_errors: true + accepts_nested_attributes_for :tuning_pegs +end diff --git a/activerecord/test/models/tuning_peg.rb b/activerecord/test/models/tuning_peg.rb new file mode 100644 index 0000000000..1252d6dc1d --- /dev/null +++ b/activerecord/test/models/tuning_peg.rb @@ -0,0 +1,4 @@ +class TuningPeg < ActiveRecord::Base + belongs_to :guitar + validates_numericality_of :pitch +end |