forked from metaskills/grouped_scope
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved to non dynamic class constant creation. Using assert_contains i…
…n a few places.
- Loading branch information
1 parent
96d0858
commit e82bb3c
Showing
5 changed files
with
50 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
class Employee < ActiveRecord::Base | ||
has_many :reports | ||
grouped_scope :reports | ||
end | ||
|
||
class Report < ActiveRecord::Base | ||
belongs_to :employee | ||
end | ||
|
||
class LegacyEmployee < ActiveRecord::Base | ||
set_primary_key :email | ||
has_many :reports, :class_name => 'LegacyReport', :foreign_key => 'email' | ||
grouped_scope :reports | ||
end | ||
|
||
class LegacyReport < ActiveRecord::Base | ||
belongs_to :employee, :class_name => 'LegacyEmployee' | ||
end | ||
|
||
class FooBar < ActiveRecord::Base | ||
has_many :reports | ||
grouped_scope :reports | ||
end | ||
|
||
|