| Class | Asls::FrgmntsController |
| In: |
app/controllers/asls/frgmnts_controller.rb
|
| Parent: | ApplicationController |
Only show frgmnts owned by bikle or the usr (but no one else) in the current session
# File app/controllers/asls/frgmnts_controller.rb, line 20
20: def conditions_for_collection
21: bikle_usr = Usr.find_by_login("bikle")
22: (bikle_usr.nil?) ? (bikle_id = session[:usr_id]) : (bikle_id = bikle_usr.id)
23: ['frgmnts.usr_id in (?,?)', bikle_id, [session[:usr_id]]]
24: # Above statement generates SQL like this:
25: # SELECT * FROM frgmnts WHERE frgmnts.usr_id in (1, 43)
26: end