Sha256: 7d1a700743f8efd7516f4fd678f571e781e4890640dd30c6b40987654751291c

Contents?: true

Size: 267 Bytes

Versions: 12

Compression:

Stored size: 267 Bytes

Contents

# Required for ActiveSupport < 5
unless [].respond_to?(:pluck)
  module Enumerable
    def pluck(*keys)
      if keys.many?
        map { |element| keys.map { |key| element[key] } }
      else
        map { |element| element[keys.first] }
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
activeadmin-searchable_select-1.8.0 spec/support/pluck_polyfill.rb
activeadmin-searchable_select-1.7.0 spec/support/pluck_polyfill.rb
activeadmin-searchable_select-1.6.0 spec/support/pluck_polyfill.rb
activeadmin-searchable_select-1.5.0 spec/support/pluck_polyfill.rb
activeadmin-searchable_select-1.4.0 spec/support/pluck_polyfill.rb
activeadmin-searchable_select-1.3.0 spec/support/pluck_polyfill.rb
activeadmin-searchable_select-1.2.1 spec/support/pluck_polyfill.rb
activeadmin-searchable_select-1.2.0 spec/support/pluck_polyfill.rb
activeadmin-searchable_select-1.1.0 spec/support/pluck_polyfill.rb
activeadmin-searchable_select-1.0.2 spec/support/pluck_polyfill.rb
activeadmin-searchable_select-1.0.1 spec/support/pluck_polyfill.rb
activeadmin-searchable_select-1.0.0 spec/support/pluck_polyfill.rb