Guest User

Untitled

a guest
May 24th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. class User < ActiveRecord::Base
  2. has_many :places
  3. has_many :rooms, :through => :places
  4.  
  5. named_scope :inside, lambda {|room|
  6. { :conditions => { 'place.room_id' => room }} # doesn't work
  7. }
  8.  
  9. # ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: place.room_id: SELECT * FROM "users" WHERE ("place"."room_id" = 1)
  10. end
Add Comment
Please, Sign In to add comment