change styling towards design rj
This commit is contained in:
@@ -14,6 +14,14 @@ class Section
|
||||
|
||||
validates :supplier_id, presence: true
|
||||
|
||||
# Probably faster to directly retreive the document and return nil
|
||||
# if the supplier does not match
|
||||
def self.find_by_supplier_and_id(supplier, id)
|
||||
section = find(id)
|
||||
return nil unless section.supplier_id == supplier.id
|
||||
section
|
||||
end
|
||||
|
||||
def width
|
||||
self.path.last.try(:first).to_f - self.path.first.try(:first).to_f
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user