hyper-mesh icon indicating copy to clipboard operation
hyper-mesh copied to clipboard

add slice method to ActiveRecord models

Open catmando opened this issue 8 years ago • 0 comments

Adapted from active record:

module ActiveRecord
  module InstanceMethods
    def slice(methods)
      Hash[methods.map! { |method| [method, send(method)] }]
    end
  end
end

catmando avatar Sep 13 '17 20:09 catmando