aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2014-08-28 15:50:14 +0900
committerAkira Matsuda <ronnie@dio.jp>2014-08-28 15:50:14 +0900
commit4304eb8b5e7ecc08a631b935f0752656e88b479c (patch)
tree2ed5e319f10d3c8c6feb7af5791e544045684aa7 /activerecord/test
parent9489b212eb1e9bc3972f968a4d0213390db853a9 (diff)
downloadrails-4304eb8b5e7ecc08a631b935f0752656e88b479c.tar.gz
rails-4304eb8b5e7ecc08a631b935f0752656e88b479c.tar.bz2
rails-4304eb8b5e7ecc08a631b935f0752656e88b479c.zip
Move association definition to the model file
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/calculations_test.rb2
-rw-r--r--activerecord/test/models/company.rb1
2 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb
index 06a196711c..ec6a319ab5 100644
--- a/activerecord/test/cases/calculations_test.rb
+++ b/activerecord/test/cases/calculations_test.rb
@@ -11,8 +11,6 @@ require 'models/minivan'
require 'models/speedometer'
require 'models/ship_part'
-Company.has_many :accounts
-
class NumericData < ActiveRecord::Base
self.table_name = 'numeric_data'
diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb
index 76411ecb37..42f7fb4680 100644
--- a/activerecord/test/models/company.rb
+++ b/activerecord/test/models/company.rb
@@ -10,6 +10,7 @@ class Company < AbstractCompany
has_one :dummy_account, :foreign_key => "firm_id", :class_name => "Account"
has_many :contracts
has_many :developers, :through => :contracts
+ has_many :accounts
scope :of_first_firm, lambda {
joins(:account => :firm).