Sha256: 79a3aee600509abaaf37c02c97ba52285ee721bace3e9267a8ece24a8f76c18c

Contents?: true

Size: 246 Bytes

Versions: 9

Compression:

Stored size: 246 Bytes

Contents

module Lookupable
  extend ActiveSupport::Concern

  def to_lookup
    { :id => self.id, :code => self.code, :name => self.name }
  end

  module ClassMethods
    def to_lookup
      all.map do |i|
        i.to_lookup
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
logistics_core-21.11.2 app/models/concerns/lookupable.rb
logistics_core-21.11.1 app/models/concerns/lookupable.rb
logistics_core-21.08.1 app/models/concerns/lookupable.rb
logistics_core-21.03.1 app/models/concerns/lookupable.rb
logistics_core-20.10.3 app/models/concerns/lookupable.rb
logistics_core-20.10.2 app/models/concerns/lookupable.rb
logistics_core-20.10.1 app/models/concerns/lookupable.rb
logistics_core-20.9.1 app/models/concerns/lookupable.rb
logistics_core-20.8.1 app/models/concerns/lookupable.rb