Sha256: 139cdf8e4aa7954290a870851081fefd86de43c32116ae9347ac76d1e9c5f31f

Contents?: true

Size: 438 Bytes

Versions: 6

Compression:

Stored size: 438 Bytes

Contents

class Room < ActiveRecord::Base
  self.primary_keys = :dorm_id, :room_id
  belongs_to :dorm
  has_many :room_assignments, :foreign_key =>  [:dorm_id, :room_id]
  has_many :room_attribute_assignments, :foreign_key =>  [:dorm_id, :room_id]
  has_many :room_attributes, :through => :room_attribute_assignments
  
  def find_custom_room_attributes
    room_attributes.find(:all, :conditions => ["room_attributes.name != ?", "keg"])
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
composite_primary_keys-5.0.6 test/fixtures/room.rb
composite_primary_keys-5.0.5 test/fixtures/room.rb
composite_primary_keys-5.0.4 test/fixtures/room.rb
composite_primary_keys-5.0.2 test/fixtures/room.rb
composite_primary_keys-5.0.1 test/fixtures/room.rb
composite_primary_keys-5.0.0 test/fixtures/room.rb