Skip to content

Commit

Permalink
Forgot to commit entity company scope (oops)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Lécuelle committed Feb 16, 2017
1 parent edbd80d commit 0140278
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/models/entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ class Entity < Ekylibre::Record::Base
scope :transporters, -> { where(transporter: true) }
scope :clients, -> { where(client: true) }
scope :employees, -> { where(employee: true) }
scope :company, -> { where(of_company: true).first }
scope :related_to, lambda { |entity|
where("id IN (SELECT linked_id FROM #{EntityLink.table_name} WHERE entity_id = ?) OR id IN (SELECT entity_id FROM #{EntityLink.table_name} WHERE linked_id = ?)", entity.id, entity.id)
}
Expand Down

0 comments on commit 0140278

Please sign in to comment.