Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @user = User.joins(:user_subscriptions)
- .where('user_subscriptions.friendly_code ILIKE :kode', kode: truncated_card_code)
- .first
- @user ||= User.joins(film_tickets: :promotion_card)
- .where('promotion_cards.card_code ILIKE :kode', kode: truncated_card_code)
- .group('users.id')
- .first
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement