Sha256: a34641cf155839fcd6f1bce20cc3bfe7a7ac7ae8ebbff51110d3c51ffe526691

Contents?: true

Size: 273 Bytes

Versions: 1

Compression:

Stored size: 273 Bytes

Contents

require 'active_record'

module CustomHelpers
  def to_array_by_keys(keys)
    values = []
    keys.each do |key|
      values << self.send(key) if keys.include?(key.to_s)
    end
    values
  end
end

module ActiveRecord
  class Base
    prepend CustomHelpers
  end
end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
easytable-0.0.3 lib/easytable/active_record.rb