Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- + def localized_collections_for(region, locale)
- + where(
- + id: CollectionRegion.select(:collection_id).
- + where('collection_id NOT IN(?)',
- + CollectionRegion.
- + select(:collection_id).
- + where(region_id: region.id).
- + where('available_at > ?', DateTime.now)).
- + where('available_at IS NULL OR available_at <= ?', DateTime.now).
- + where(region_id: [region.id, Region.global.id])
- + ).available_for_user_language(locale)
- + end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement