Sha256: 4664c0589c3ecd4e9812d8dd662fe8cde300648ab819514ad9594599d6c17cec

Contents?: true

Size: 417 Bytes

Versions: 63

Compression:

Stored size: 417 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.where("room_attributes.name != ?", "type")
  end
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
composite_primary_keys-13.0.8 test/fixtures/room.rb
composite_primary_keys-14.0.6 test/fixtures/room.rb
composite_primary_keys-13.0.7 test/fixtures/room.rb
composite_primary_keys-13.0.6 test/fixtures/room.rb
composite_primary_keys-14.0.5 test/fixtures/room.rb
composite_primary_keys-13.0.5 test/fixtures/room.rb
composite_primary_keys-13.0.4 test/fixtures/room.rb
composite_primary_keys-14.0.4 test/fixtures/room.rb
composite_primary_keys-14.0.3 test/fixtures/room.rb
composite_primary_keys-13.0.3 test/fixtures/room.rb
composite_primary_keys-14.0.2 test/fixtures/room.rb
composite_primary_keys-13.0.2 test/fixtures/room.rb
composite_primary_keys-14.0.1 test/fixtures/room.rb
composite_primary_keys-9.0.9 test/fixtures/room.rb
composite_primary_keys-11.0.0.rc2 test/fixtures/room.rb
composite_primary_keys-10.0.3 test/fixtures/room.rb
composite_primary_keys-11.0.0.rc1 test/fixtures/room.rb
composite_primary_keys-11.0.0.beta4 test/fixtures/room.rb
composite_primary_keys-11.0.0.beta3 test/fixtures/room.rb
composite_primary_keys-11.0.0.beta2 test/fixtures/room.rb