Sha256: 07db53a491d55aa19098a14471c123230161f0eab9c3e6d9c639233a8ff79c2a

Contents?: true

Size: 682 Bytes

Versions: 25

Compression:

Stored size: 682 Bytes

Contents

require "rubygems"
require 'mongo_mapper'

MongoMapper.connection = Mongo::Connection.new('localhost', 27017)
MongoMapper.database = "datagrid_mongo_mapper"

class MongoMapperEntry
  include MongoMapper::Document

  key :group_id, Integer
  key :name, String
  key :category, String
  key :disabled, Boolean, :default => false
  key :confirmed, Boolean, :default => false
  key :shipping_date, DateTime
  timestamps!

end

class MongoMapperGrid
  include ::Datagrid

  scope do
    MongoMapperEntry
  end

  filter :name
  integer_range_filters(:group_id, {:default => 0}, {:default => 100})
  filter :disabled, :eboolean

  column :name
  column :group_id
  column :disabled

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
datagrid-1.1.2 spec/support/mongo_mapper.rb
datagrid-1.1.1 spec/support/mongo_mapper.rb
datagrid-1.1.0 spec/support/mongo_mapper.rb
datagrid-1.0.5 spec/support/mongo_mapper.rb
datagrid-1.0.4 spec/support/mongo_mapper.rb
datagrid-1.0.3 spec/support/mongo_mapper.rb
datagrid-1.0.2 spec/support/mongo_mapper.rb
datagrid-1.0.1 spec/support/mongo_mapper.rb
datagrid-1.0.0 spec/support/mongo_mapper.rb
datagrid-0.9.3 spec/support/mongo_mapper.rb
datagrid-0.9.2 spec/support/mongo_mapper.rb
datagrid-0.9.0 spec/support/mongo_mapper.rb
datagrid-0.8.4 spec/support/mongo_mapper.rb
datagrid-0.8.3 spec/support/mongo_mapper.rb
datagrid-0.8.2 spec/support/mongo_mapper.rb
datagrid-0.8.1 spec/support/mongo_mapper.rb
datagrid-0.8.0 spec/support/mongo_mapper.rb
datagrid-0.7.1 spec/support/mongo_mapper.rb
datagrid-0.7.0 spec/support/mongo_mapper.rb
datagrid-0.6.4 spec/support/mongo_mapper.rb