Sha256: 9d1b6b81c52e1a43890fcd359d9ae1d3846095781096391c7c0a80bf286463d0

Contents?: true

Size: 479 Bytes

Versions: 9

Compression:

Stored size: 479 Bytes

Contents

module G5Updatable
  class Location < ActiveRecord::Base
    include G5Updatable::FirstClassProperties
    include G5Updatable::UrnAsParameter
    include BelongsToClient

    validates :uid, :urn, :client_uid, presence: true

    scope :by_client_uid, -> (client_uid) { where(client_uid: client_uid) }
    scope :by_urn, -> (urn) { where(urn: urn) }
    scope :max_updated_at, -> { maximum(:updated_at) }

    delegate :urn, to: :client, prefix: true, allow_nil: true
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
g5_updatable-0.10.2 app/models/g5_updatable/location.rb
g5_updatable-0.10.1 app/models/g5_updatable/location.rb
g5_updatable-0.10.0 app/models/g5_updatable/location.rb
g5_updatable-0.9.0 app/models/g5_updatable/location.rb
g5_updatable-0.8.0 app/models/g5_updatable/location.rb
g5_updatable-0.7.2 app/models/g5_updatable/location.rb
g5_updatable-0.7.1 app/models/g5_updatable/location.rb
g5_updatable-0.7.0 app/models/g5_updatable/location.rb
g5_updatable-0.6.1 app/models/g5_updatable/location.rb