Sha256: 9edb6c77fdb354ca0226415f16c9f27cbdbb613f9d2085901e572cb2462fcb21

Contents?: true

Size: 439 Bytes

Versions: 9

Compression:

Stored size: 439 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 != ?", "type"])
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
composite_primary_keys-5.0.14 test/fixtures/room.rb
composite_primary_keys-6.0.1 test/fixtures/room.rb
composite_primary_keys-6.0.0 test/fixtures/room.rb
composite_primary_keys-5.0.13 test/fixtures/room.rb
composite_primary_keys-5.0.12 test/fixtures/room.rb
composite_primary_keys-5.0.11 test/fixtures/room.rb
composite_primary_keys-5.0.10 test/fixtures/room.rb
composite_primary_keys-5.0.9 test/fixtures/room.rb
composite_primary_keys-5.0.8 test/fixtures/room.rb