Class: Property

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/property.rb

Class Method Summary collapse

Class Method Details

.find_all_by_prototype(prototype) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'app/models/property.rb', line 11

def self.find_all_by_prototype(prototype)
  id = prototype
  if prototype.class == Prototype
    id = prototype.id
  end

  find(:all, :conditions => [ 'prototype_id = ?', id ],
       :joins => 'left join properties_prototypes on property_id = properties.id')
end