Sha256: 2b4e5a8cc822402a0a4e7abcd165c367655e1a0c284b8df636f4752a9dae0fb1

Contents?: true

Size: 413 Bytes

Versions: 3

Compression:

Stored size: 413 Bytes

Contents

module CsvRails
  module Mongoid
    def self.included(base)
      base.send(:include, CsvRails::ActiveModel::InstanceMethods)
      base.const_get(:ClassMethods).tap{|klass|
        klass.send(:include, CsvRails::ActiveModel::ClassMethods)
        klass.send(:include, ClassMethods)
      }
    end

    module ClassMethods
      def attribute_names
        fields.keys.map(&:to_sym)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
csv_rails-0.7.0 lib/csv_rails/mongoid.rb
csv_rails-0.6.1 lib/csv_rails/mongoid.rb
csv_rails-0.6.0 lib/csv_rails/mongoid.rb