aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/ship.rb
diff options
context:
space:
mode:
authorEric Chahin <erc73@cornell.edu>2014-05-01 02:38:15 -0400
committerEric Chahin <erc73@cornell.edu>2014-05-01 03:27:24 -0400
commitc6d685ba1118cc1f6303122117df945ebe8fceae (patch)
treeb9d3b46fc5b454d8b8089411182da5cf936332c2 /activerecord/test/models/ship.rb
parent876155705b56e66a8b9ed96f7b79d1c8d1763200 (diff)
downloadrails-c6d685ba1118cc1f6303122117df945ebe8fceae.tar.gz
rails-c6d685ba1118cc1f6303122117df945ebe8fceae.tar.bz2
rails-c6d685ba1118cc1f6303122117df945ebe8fceae.zip
Fixed custom validation context bug where child
associations were not being saved. Fixes #13854. [Eric Chahin, Aaron Nelson, & Kevin Casey]
Diffstat (limited to 'activerecord/test/models/ship.rb')
-rw-r--r--activerecord/test/models/ship.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/models/ship.rb b/activerecord/test/models/ship.rb
index 3da031946f..77a4728d0b 100644
--- a/activerecord/test/models/ship.rb
+++ b/activerecord/test/models/ship.rb
@@ -17,3 +17,9 @@ class Ship < ActiveRecord::Base
false
end
end
+
+class FamousShip < ActiveRecord::Base
+ self.table_name = 'ships'
+ belongs_to :famous_pirate
+ validates_presence_of :name, on: :conference
+end