From c6d685ba1118cc1f6303122117df945ebe8fceae Mon Sep 17 00:00:00 2001 From: Eric Chahin Date: Thu, 1 May 2014 02:38:15 -0400 Subject: Fixed custom validation context bug where child associations were not being saved. Fixes #13854. [Eric Chahin, Aaron Nelson, & Kevin Casey] --- activerecord/test/models/pirate.rb | 6 ++++++ activerecord/test/models/ship.rb | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'activerecord/test/models') diff --git a/activerecord/test/models/pirate.rb b/activerecord/test/models/pirate.rb index e472cf951d..90a3c3ecee 100644 --- a/activerecord/test/models/pirate.rb +++ b/activerecord/test/models/pirate.rb @@ -84,3 +84,9 @@ end class DestructivePirate < Pirate has_one :dependent_ship, :class_name => 'Ship', :foreign_key => :pirate_id, :dependent => :destroy end + +class FamousPirate < ActiveRecord::Base + self.table_name = 'pirates' + has_many :famous_ships + validates_presence_of :catchphrase, on: :conference +end \ No newline at end of file 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 -- cgit v1.2.3