Sha256: 22acf532dcea661bddb9099825be63cdd060fe8bf6e174490e6538013030d034
Contents?: true
Size: 804 Bytes
Versions: 1
Compression:
Stored size: 804 Bytes
Contents
module G5Updatable class HubAmenity < ActiveRecord::Base validates :external_id, presence: true has_many :hub_amenities_locations, foreign_key: :g5_updatable_hub_amenity_id scope :by_client_urn, -> (client_urn) { joins(hub_amenities_locations: { location: :client }). where('g5_updatable_clients.urn = :client_urn', client_urn: client_urn).uniq } scope :by_client_urns, -> (client_urns) { joins(hub_amenities_locations: { location: :client }). where('g5_updatable_clients.urn IN (:client_urns)', client_urns: client_urns.join(',')).uniq } scope :by_client_uid, -> (client_uid) { joins(hub_amenities_locations: :location). where('g5_updatable_locations.client_uid = :client_uid', client_uid: client_uid).uniq } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
g5_updatable-0.20.3.pre.1 | app/models/g5_updatable/hub_amenity.rb |