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
# File 'app/models/property.rb', line 11

def self.find_all_by_prototype(prototype)
  id = prototype
  if prototype.class == Prototype
    id = prototype.id
  end
  joins('left join properties_prototypes on property_id = properties.id').where('prototype_id = ?', id)
end