Sha256: 409fa019e42ce001c32c17ec7cc0ba40aeed6a9432e18eb715621d4bbdaed1f5
Contents?: true
Size: 573 Bytes
Versions: 5
Compression:
Stored size: 573 Bytes
Contents
class Organization < Taxonomy include Foreman::ThreadSession::OrganizationModel has_and_belongs_to_many :locations has_many_hosts :dependent => :nullify scope :completer_scope, lambda { my_organizations } scope :my_organizations, lambda { user = User.current if user.admin? conditions = { } else conditions = sanitize_sql_for_conditions([" (taxonomies.id in (?))", user.organization_ids]) end where(conditions).reorder('type, name') } def dup new = super new.locations = locations new end end
Version data entries
5 entries across 5 versions & 1 rubygems