Guest User

Untitled

a guest
Dec 13th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.40 KB | None | 0 0
  1. module CountryRepository
  2.   extend ActiveSupport::Concern
  3.  
  4.   included do
  5.     scope :asc_by_localized_name, lambda{ |l| self.send "asc_by_name_#{l}" }
  6.     scope :with_published_localized_people, ->(l) { joins(:people).where(:people => { :state => 'published', l => true }).uniq }
  7.     scope :for_people_filter, -> { with_published_localized_people(I18n.locale).asc_by_localized_name(I18n.locale) }
  8.   end
  9.  
  10. end
Add Comment
Please, Sign In to add comment