diff options
Diffstat (limited to 'activerecord/test/models/company_in_module.rb')
-rw-r--r-- | activerecord/test/models/company_in_module.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/activerecord/test/models/company_in_module.rb b/activerecord/test/models/company_in_module.rb index b444f9c49c..e035a80ab8 100644 --- a/activerecord/test/models/company_in_module.rb +++ b/activerecord/test/models/company_in_module.rb @@ -6,23 +6,23 @@ module MyApplication end class Firm < Company - has_many :clients, -> { order("id") }, :dependent => :destroy - has_many :clients_sorted_desc, -> { order("id DESC") }, :class_name => "Client" - has_many :clients_of_firm, -> { order "id" }, :foreign_key => "client_of", :class_name => "Client" - has_many :clients_like_ms, -> { where("name = 'Microsoft'").order("id") }, :class_name => "Client" - has_one :account, :class_name => "MyApplication::Billing::Account", :dependent => :destroy + has_many :clients, -> { order("id") }, dependent: :destroy + has_many :clients_sorted_desc, -> { order("id DESC") }, class_name: "Client" + has_many :clients_of_firm, -> { order "id" }, foreign_key: "client_of", class_name: "Client" + has_many :clients_like_ms, -> { where("name = 'Microsoft'").order("id") }, class_name: "Client" + has_one :account, class_name: "MyApplication::Billing::Account", dependent: :destroy end class Client < Company - belongs_to :firm, :foreign_key => "client_of" - belongs_to :firm_with_other_name, :class_name => "Firm", :foreign_key => "client_of" + belongs_to :firm, foreign_key: "client_of" + belongs_to :firm_with_other_name, class_name: "Firm", foreign_key: "client_of" class Contact < ActiveRecord::Base; end end class Developer < ActiveRecord::Base has_and_belongs_to_many :projects - validates_length_of :name, :within => (3..20) + validates_length_of :name, within: (3..20) end class Project < ActiveRecord::Base @@ -78,12 +78,12 @@ module MyApplication end class Account < ActiveRecord::Base - with_options(:foreign_key => :firm_id) do |i| - i.belongs_to :firm, :class_name => "MyApplication::Business::Firm" - i.belongs_to :qualified_billing_firm, :class_name => "MyApplication::Billing::Firm" - i.belongs_to :unqualified_billing_firm, :class_name => "Firm" - i.belongs_to :nested_qualified_billing_firm, :class_name => "MyApplication::Billing::Nested::Firm" - i.belongs_to :nested_unqualified_billing_firm, :class_name => "Nested::Firm" + with_options(foreign_key: :firm_id) do |i| + i.belongs_to :firm, class_name: "MyApplication::Business::Firm" + i.belongs_to :qualified_billing_firm, class_name: "MyApplication::Billing::Firm" + i.belongs_to :unqualified_billing_firm, class_name: "Firm" + i.belongs_to :nested_qualified_billing_firm, class_name: "MyApplication::Billing::Nested::Firm" + i.belongs_to :nested_unqualified_billing_firm, class_name: "Nested::Firm" end validate :check_empty_credit_limit |