diff options
author | Lauro Caetano <laurocaetano1@gmail.com> | 2014-02-08 18:46:32 -0200 |
---|---|---|
committer | Lauro Caetano <laurocaetano1@gmail.com> | 2014-02-08 18:57:26 -0200 |
commit | 1ea61cb9bc95bf3857012850ffb475836e5d88e8 (patch) | |
tree | 6ba56d2465d58c58a26509d372358f99a8c9e046 /activerecord/test/models/electron.rb | |
parent | 77577149f71e1fa0df15dbc02ae7c33349dddba8 (diff) | |
download | rails-1ea61cb9bc95bf3857012850ffb475836e5d88e8.tar.gz rails-1ea61cb9bc95bf3857012850ffb475836e5d88e8.tar.bz2 rails-1ea61cb9bc95bf3857012850ffb475836e5d88e8.zip |
Add test case for autosave HasMany with accepts_nested_attributes.
It should not save the parent record when the nested attributes are
invalid.
Test case to cover #8194.
Diffstat (limited to 'activerecord/test/models/electron.rb')
-rw-r--r-- | activerecord/test/models/electron.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/models/electron.rb b/activerecord/test/models/electron.rb index 35af9f679b..6fc270673f 100644 --- a/activerecord/test/models/electron.rb +++ b/activerecord/test/models/electron.rb @@ -1,3 +1,5 @@ class Electron < ActiveRecord::Base belongs_to :molecule + + validates_presence_of :name end |