20 lines
524 B
Ruby
20 lines
524 B
Ruby
class SectionElement
|
|
include SimplyStored::Couch
|
|
include ActiveModel::SerializerSupport
|
|
include SvgElementDefaults
|
|
property :position_x, type: Float
|
|
property :position_y, type: Float
|
|
property :rotation, type: Float
|
|
belongs_to :section
|
|
belongs_to :supplier
|
|
belongs_to :svg_element
|
|
|
|
view :by_supplier_id, key: :supplier_id
|
|
view :by_section_id, key: :section_id
|
|
view :by_supplier_id_and_id, key: [:supplier_id, :_id]
|
|
|
|
def self.for_supplier(supplier)
|
|
find_all_by_supplier_id(supplier.id)
|
|
end
|
|
end
|