Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- named_scope :for_user, lambda{ |user|
- conditions = user.is_admin? ? '': ['accounts.id = ?',user.account.id]
- {:joins => 'left join accounts on accounts.id = projects.account_id', :conditions=> conditions}
- }
Add Comment
Please, Sign In to add comment