Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## in a controller:
- # Is there a cleaner way of expressing this:
- @contracts = Contract.find( @user.facilities.map{|f| f.contract_id } )
- # User: has_many => :facilities, :through => :user_facilities
- # Contracts: has_many => :facilties & facilites belongs_to Contracts
- # I'd like to do something like: @user.facilities.contracts, but there doesn't seem to be a way to do this in Rails
Add Comment
Please, Sign In to add comment