diff options
author | Rafael Sales <rafaelcds@gmail.com> | 2015-10-13 09:06:50 -0300 |
---|---|---|
committer | Rafael Sales <rafaelcds@gmail.com> | 2015-10-22 04:23:56 -0300 |
commit | 4f21d42faaf12955fa0116306966d4ef09e62462 (patch) | |
tree | 99ab3fe330485d4f4dc01b7c7725796504e046c0 /activerecord/test/models | |
parent | c2d33c4abf01ec25b2d1528a7dae923aef5a30af (diff) | |
download | rails-4f21d42faaf12955fa0116306966d4ef09e62462.tar.gz rails-4f21d42faaf12955fa0116306966d4ef09e62462.tar.bz2 rails-4f21d42faaf12955fa0116306966d4ef09e62462.zip |
Refactor Calculations#execute_grouped_calculation and clean AR test case
* When tried to use `Company#accounts` test/models/company.rb I got:
```
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column:
accounts.company_id: SELECT COUNT(*) AS count_all, "companies"."firm_id"
AS companies_firm_id FROM "companies" INNER JOIN "accounts" ON
"accounts"."company_id" = "companies"."id" GROUP BY "companies"."firm_id"
```
* The refactor on Calculations class was just to simplify the code
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/company.rb | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb index a96b8ef0f2..1dcd9fc21e 100644 --- a/activerecord/test/models/company.rb +++ b/activerecord/test/models/company.rb @@ -10,7 +10,6 @@ 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). |