Sha256: 1e0d67dd5ba32e4533aa0fd17cd7f5f4da888130c61aabc1b59fcaa549b9babc

Contents?: true

Size: 842 Bytes

Versions: 23

Compression:

Stored size: 842 Bytes

Contents

require "rubygems"
require 'mongoid'


Mongoid.from_hash({
  "host" => "localhost",
  "database" =>"datagrid_mongoid",
  "autocreate_indexes" => true,
  "logger" => nil,
})

#Mongoid.logger = TEST_LOGGER #TODO: understand why still output to STDOUT


class MongoidEntry

  include Mongoid::Document
  include Mongoid::Timestamps

  field :group_id, :type => Integer
  field :name, :type => String
  field :category, :type => String
  field :disabled, :default => false, :type => Boolean
  field :confirmed, :default => false, :type => Boolean
  field :shipping_date, :type => DateTime

end

class MongoidGrid
  include ::Datagrid

  scope do
    MongoidEntry
  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

23 entries across 23 versions & 1 rubygems

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