diff options
Diffstat (limited to 'activerecord/test/models/ship.rb')
-rw-r--r-- | activerecord/test/models/ship.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/test/models/ship.rb b/activerecord/test/models/ship.rb index e333b964ab..77a7b22315 100644 --- a/activerecord/test/models/ship.rb +++ b/activerecord/test/models/ship.rb @@ -2,19 +2,19 @@ class Ship < ActiveRecord::Base self.record_timestamps = false belongs_to :pirate - belongs_to :update_only_pirate, :class_name => 'Pirate' + belongs_to :update_only_pirate, class_name: "Pirate" belongs_to :developer, dependent: :destroy - has_many :parts, :class_name => 'ShipPart' + has_many :parts, class_name: "ShipPart" has_many :treasures - accepts_nested_attributes_for :parts, :allow_destroy => true - accepts_nested_attributes_for :pirate, :allow_destroy => true, :reject_if => proc(&:empty?) - accepts_nested_attributes_for :update_only_pirate, :update_only => true + accepts_nested_attributes_for :parts, allow_destroy: true + accepts_nested_attributes_for :pirate, allow_destroy: true, reject_if: proc(&:empty?) + accepts_nested_attributes_for :update_only_pirate, update_only: true validates_presence_of :name attr_accessor :cancel_save_from_callback - before_save :cancel_save_callback_method, :if => :cancel_save_from_callback + before_save :cancel_save_callback_method, if: :cancel_save_from_callback def cancel_save_callback_method throw(:abort) end @@ -33,7 +33,7 @@ class Prisoner < ActiveRecord::Base end class FamousShip < ActiveRecord::Base - self.table_name = 'ships' + self.table_name = "ships" belongs_to :famous_pirate validates_presence_of :name, on: :conference end |