Sha256: 58d59ab2c7e8f64bd5d86f9f1ab0a4a81c3ccbe37ecd954a07c1c3603c00cdaf

Contents?: true

Size: 220 Bytes

Versions: 66

Compression:

Stored size: 220 Bytes

Contents

module Agilibox::PluckToHash
  extend ActiveSupport::Concern

  class_methods do
    def pluck_to_hash(*attributes)
      pluck(*attributes).map { |values| attributes.zip(values).to_h }
    end
  end # class_methods
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
agilibox-2.0.0 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.11.0 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.10.5 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.10.2 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.10.1 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.10.0 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.9.20 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.9.19 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.9.18 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.9.17 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.9.16 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.9.15 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.9.14 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.9.13 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.9.12 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.9.11 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.9.10 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.9.9 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.9.8 app/models/concerns/agilibox/pluck_to_hash.rb
agilibox-1.9.7 app/models/concerns/agilibox/pluck_to_hash.rb