Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.55 KB | None | 0 0
  1. +    def localized_collections_for(region, locale)
  2.  +      where(
  3.  +        id: CollectionRegion.select(:collection_id).
  4.  +          where('collection_id NOT IN(?)',
  5.  +                CollectionRegion.
  6.  +                  select(:collection_id).
  7.  +                  where(region_id: region.id).
  8.  +                  where('available_at > ?', DateTime.now)).
  9.  +          where('available_at IS NULL OR available_at <= ?', DateTime.now).
  10.  +          where(region_id: [region.id, Region.global.id])
  11.  +      ).available_for_user_language(locale)
  12.  +    end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement