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