Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module CountryRepository
- extend ActiveSupport::Concern
- included do
- scope :asc_by_localized_name, lambda{ |l| self.send "asc_by_name_#{l}" }
- scope :with_published_localized_people, ->(l) { joins(:people).where(:people => { :state => 'published', l => true }).uniq }
- scope :for_people_filter, -> { with_published_localized_people(I18n.locale).asc_by_localized_name(I18n.locale) }
- end
- end
Add Comment
Please, Sign In to add comment