Created
December 10, 2010 10:07
-
-
Save spint/736043 to your computer and use it in GitHub Desktop.
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
class LowCoverReport < ActiveRecord::Base | |
# This seems to be working fine, but is it the "right" way to achieve this ? | |
@@country_query = lambda{|o| {:conditions => ["country_id IN (#{o.countries.collect{|c| c.id}.join(', ')})"]} } | |
named_scope :for_user, @@country_query | |
named_scope :for_session, @@country_query | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment