Advertisement
druznek

tff2017-auth-user

Apr 28th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.34 KB | None | 0 0
  1. @user = User.joins(:user_subscriptions)
  2.           .where('user_subscriptions.friendly_code ILIKE :kode', kode: truncated_card_code)
  3.           .first
  4.  
  5. @user ||= User.joins(film_tickets: :promotion_card)
  6.             .where('promotion_cards.card_code ILIKE :kode', kode: truncated_card_code)
  7.             .group('users.id')
  8.             .first
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement