chhean-mongoid 2.0.1.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT_LICENSE +20 -0
- data/README.rdoc +49 -0
- data/lib/mongoid.rb +139 -0
- data/lib/mongoid/associations.rb +327 -0
- data/lib/mongoid/associations/embedded_in.rb +72 -0
- data/lib/mongoid/associations/embeds_many.rb +262 -0
- data/lib/mongoid/associations/embeds_one.rb +95 -0
- data/lib/mongoid/associations/foreign_key.rb +35 -0
- data/lib/mongoid/associations/meta_data.rb +29 -0
- data/lib/mongoid/associations/options.rb +73 -0
- data/lib/mongoid/associations/proxy.rb +33 -0
- data/lib/mongoid/associations/referenced_in.rb +71 -0
- data/lib/mongoid/associations/references_many.rb +243 -0
- data/lib/mongoid/associations/references_many_as_array.rb +78 -0
- data/lib/mongoid/associations/references_one.rb +116 -0
- data/lib/mongoid/attributes.rb +226 -0
- data/lib/mongoid/callbacks.rb +17 -0
- data/lib/mongoid/collection.rb +120 -0
- data/lib/mongoid/collections.rb +41 -0
- data/lib/mongoid/collections/cyclic_iterator.rb +34 -0
- data/lib/mongoid/collections/master.rb +29 -0
- data/lib/mongoid/collections/operations.rb +41 -0
- data/lib/mongoid/collections/slaves.rb +45 -0
- data/lib/mongoid/components.rb +32 -0
- data/lib/mongoid/config.rb +237 -0
- data/lib/mongoid/contexts.rb +24 -0
- data/lib/mongoid/contexts/enumerable.rb +151 -0
- data/lib/mongoid/contexts/ids.rb +25 -0
- data/lib/mongoid/contexts/mongo.rb +285 -0
- data/lib/mongoid/contexts/paging.rb +50 -0
- data/lib/mongoid/criteria.rb +230 -0
- data/lib/mongoid/criterion/complex.rb +21 -0
- data/lib/mongoid/criterion/exclusion.rb +65 -0
- data/lib/mongoid/criterion/inclusion.rb +110 -0
- data/lib/mongoid/criterion/optional.rb +136 -0
- data/lib/mongoid/cursor.rb +82 -0
- data/lib/mongoid/deprecation.rb +22 -0
- data/lib/mongoid/dirty.rb +254 -0
- data/lib/mongoid/document.rb +264 -0
- data/lib/mongoid/errors.rb +124 -0
- data/lib/mongoid/extensions.rb +106 -0
- data/lib/mongoid/extensions/array/accessors.rb +17 -0
- data/lib/mongoid/extensions/array/aliasing.rb +4 -0
- data/lib/mongoid/extensions/array/assimilation.rb +26 -0
- data/lib/mongoid/extensions/array/conversions.rb +27 -0
- data/lib/mongoid/extensions/array/parentization.rb +13 -0
- data/lib/mongoid/extensions/big_decimal/conversions.rb +19 -0
- data/lib/mongoid/extensions/binary/conversions.rb +17 -0
- data/lib/mongoid/extensions/boolean/conversions.rb +22 -0
- data/lib/mongoid/extensions/date/conversions.rb +24 -0
- data/lib/mongoid/extensions/datetime/conversions.rb +12 -0
- data/lib/mongoid/extensions/float/conversions.rb +20 -0
- data/lib/mongoid/extensions/hash/accessors.rb +38 -0
- data/lib/mongoid/extensions/hash/assimilation.rb +39 -0
- data/lib/mongoid/extensions/hash/conversions.rb +45 -0
- data/lib/mongoid/extensions/hash/criteria_helpers.rb +20 -0
- data/lib/mongoid/extensions/hash/scoping.rb +12 -0
- data/lib/mongoid/extensions/integer/conversions.rb +20 -0
- data/lib/mongoid/extensions/nil/assimilation.rb +17 -0
- data/lib/mongoid/extensions/object/conversions.rb +27 -0
- data/lib/mongoid/extensions/objectid/conversions.rb +15 -0
- data/lib/mongoid/extensions/proc/scoping.rb +12 -0
- data/lib/mongoid/extensions/set/conversions.rb +20 -0
- data/lib/mongoid/extensions/string/conversions.rb +15 -0
- data/lib/mongoid/extensions/string/inflections.rb +97 -0
- data/lib/mongoid/extensions/symbol/inflections.rb +39 -0
- data/lib/mongoid/extensions/time_conversions.rb +35 -0
- data/lib/mongoid/extras.rb +61 -0
- data/lib/mongoid/factory.rb +20 -0
- data/lib/mongoid/field.rb +80 -0
- data/lib/mongoid/fields.rb +61 -0
- data/lib/mongoid/finders.rb +144 -0
- data/lib/mongoid/identity.rb +39 -0
- data/lib/mongoid/indexes.rb +27 -0
- data/lib/mongoid/javascript.rb +21 -0
- data/lib/mongoid/javascript/functions.yml +37 -0
- data/lib/mongoid/matchers.rb +35 -0
- data/lib/mongoid/matchers/all.rb +11 -0
- data/lib/mongoid/matchers/default.rb +26 -0
- data/lib/mongoid/matchers/exists.rb +13 -0
- data/lib/mongoid/matchers/gt.rb +11 -0
- data/lib/mongoid/matchers/gte.rb +11 -0
- data/lib/mongoid/matchers/in.rb +11 -0
- data/lib/mongoid/matchers/lt.rb +11 -0
- data/lib/mongoid/matchers/lte.rb +11 -0
- data/lib/mongoid/matchers/ne.rb +11 -0
- data/lib/mongoid/matchers/nin.rb +11 -0
- data/lib/mongoid/matchers/size.rb +11 -0
- data/lib/mongoid/memoization.rb +33 -0
- data/lib/mongoid/named_scope.rb +37 -0
- data/lib/mongoid/observable.rb +30 -0
- data/lib/mongoid/paths.rb +62 -0
- data/lib/mongoid/persistence.rb +218 -0
- data/lib/mongoid/persistence/command.rb +39 -0
- data/lib/mongoid/persistence/insert.rb +47 -0
- data/lib/mongoid/persistence/insert_embedded.rb +38 -0
- data/lib/mongoid/persistence/remove.rb +39 -0
- data/lib/mongoid/persistence/remove_all.rb +37 -0
- data/lib/mongoid/persistence/remove_embedded.rb +50 -0
- data/lib/mongoid/persistence/update.rb +63 -0
- data/lib/mongoid/railtie.rb +54 -0
- data/lib/mongoid/railties/database.rake +37 -0
- data/lib/mongoid/scope.rb +75 -0
- data/lib/mongoid/state.rb +32 -0
- data/lib/mongoid/timestamps.rb +27 -0
- data/lib/mongoid/validations.rb +51 -0
- data/lib/mongoid/validations/associated.rb +32 -0
- data/lib/mongoid/validations/locale/en.yml +4 -0
- data/lib/mongoid/validations/uniqueness.rb +50 -0
- data/lib/mongoid/version.rb +4 -0
- data/lib/mongoid/versioning.rb +27 -0
- data/lib/rails/generators/mongoid/config/config_generator.rb +41 -0
- data/lib/rails/generators/mongoid/config/templates/mongoid.yml +24 -0
- data/lib/rails/generators/mongoid/model/model_generator.rb +24 -0
- data/lib/rails/generators/mongoid/model/templates/model.rb +15 -0
- data/lib/rails/generators/mongoid_generator.rb +61 -0
- metadata +284 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Mongoid #:nodoc:
|
3
|
+
module State #:nodoc:
|
4
|
+
# Returns true if the +Document+ has not been persisted to the database,
|
5
|
+
# false if it has. This is determined by the variable @new_record
|
6
|
+
# and NOT if the object has an id.
|
7
|
+
def new_record?
|
8
|
+
@new_record == true
|
9
|
+
end
|
10
|
+
|
11
|
+
# Sets the new_record boolean - used after document is saved.
|
12
|
+
def new_record=(saved)
|
13
|
+
@new_record = saved
|
14
|
+
end
|
15
|
+
|
16
|
+
# Checks if the document has been saved to the database.
|
17
|
+
def persisted?
|
18
|
+
!new_record?
|
19
|
+
end
|
20
|
+
|
21
|
+
# Returns true if the +Document+ has been succesfully destroyed, and false if it hasn't.
|
22
|
+
# This is determined by the variable @destroyed and NOT by checking the database.
|
23
|
+
def destroyed?
|
24
|
+
@destroyed == true
|
25
|
+
end
|
26
|
+
|
27
|
+
# Sets the destroyed boolean - used after document is destroyed.
|
28
|
+
def destroyed=(destroyed)
|
29
|
+
@destroyed = destroyed && true
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Mongoid #:nodoc:
|
3
|
+
module Timestamps
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
included do
|
6
|
+
field :created_at, :type => Time
|
7
|
+
field :updated_at, :type => Time
|
8
|
+
set_callback :create, :before, :set_created_at
|
9
|
+
set_callback :save, :before, :set_updated_at
|
10
|
+
end
|
11
|
+
|
12
|
+
module InstanceMethods
|
13
|
+
|
14
|
+
# Update the created_at field on the Document to the current time. This is
|
15
|
+
# only called on create.
|
16
|
+
def set_created_at
|
17
|
+
self.created_at = Time.now.utc if !created_at
|
18
|
+
end
|
19
|
+
|
20
|
+
# Update the updated_at field on the Document to the current time.
|
21
|
+
# This is only called on create and on save.
|
22
|
+
def set_updated_at
|
23
|
+
self.updated_at = Time.now.utc
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "mongoid/validations/associated"
|
3
|
+
require "mongoid/validations/uniqueness"
|
4
|
+
|
5
|
+
I18n.load_path << File.join(
|
6
|
+
File.dirname(__FILE__), "validations", "locale", "en.yml"
|
7
|
+
)
|
8
|
+
|
9
|
+
module Mongoid #:nodoc:
|
10
|
+
# This module provides additional validations that ActiveModel does not
|
11
|
+
# provide: validates_associated and validates_uniqueness_of
|
12
|
+
module Validations
|
13
|
+
extend ActiveSupport::Concern
|
14
|
+
included do
|
15
|
+
include ActiveModel::Validations
|
16
|
+
end
|
17
|
+
|
18
|
+
module ClassMethods #:nodoc:
|
19
|
+
# Validates whether or not an association is valid or not. Will correctly
|
20
|
+
# handle has one and has many associations.
|
21
|
+
#
|
22
|
+
# Example:
|
23
|
+
#
|
24
|
+
# class Person
|
25
|
+
# include Mongoid::Document
|
26
|
+
# embeds_one :name
|
27
|
+
# embeds_many :addresses
|
28
|
+
#
|
29
|
+
# validates_associated :name, :addresses
|
30
|
+
# end
|
31
|
+
def validates_associated(*args)
|
32
|
+
validates_with(AssociatedValidator, _merge_attributes(args))
|
33
|
+
end
|
34
|
+
|
35
|
+
# Validates whether or not a field is unique against the documents in the
|
36
|
+
# database.
|
37
|
+
#
|
38
|
+
# Example:
|
39
|
+
#
|
40
|
+
# class Person
|
41
|
+
# include Mongoid::Document
|
42
|
+
# field :title
|
43
|
+
#
|
44
|
+
# validates_uniqueness_of :title
|
45
|
+
# end
|
46
|
+
def validates_uniqueness_of(*args)
|
47
|
+
validates_with(UniquenessValidator, _merge_attributes(args))
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Mongoid #:nodoc:
|
3
|
+
module Validations #:nodoc:
|
4
|
+
# Validates whether or not an association is valid or not. Will correctly
|
5
|
+
# handle has one and has many associations.
|
6
|
+
#
|
7
|
+
# Example:
|
8
|
+
#
|
9
|
+
# class Person
|
10
|
+
# include Mongoid::Document
|
11
|
+
# embeds_one :name
|
12
|
+
# embeds_many :addresses
|
13
|
+
#
|
14
|
+
# validates_associated :name, :addresses
|
15
|
+
# end
|
16
|
+
class AssociatedValidator < ActiveModel::EachValidator
|
17
|
+
|
18
|
+
# Validates that the associations provided are either all nil or all
|
19
|
+
# valid. If neither is true then the appropriate errors will be added to
|
20
|
+
# the parent document.
|
21
|
+
#
|
22
|
+
# Example:
|
23
|
+
#
|
24
|
+
# <tt>validator.validate_each(document, :name, name)</tt>
|
25
|
+
def validate_each(document, attribute, value)
|
26
|
+
values = value.is_a?(Array) ? value : [ value ]
|
27
|
+
return if values.collect { |doc| doc.nil? || doc.valid? }.all?
|
28
|
+
document.errors.add(attribute, :invalid, :default => options[:message], :value => value)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Mongoid #:nodoc:
|
3
|
+
module Validations #:nodoc:
|
4
|
+
# Validates whether or not a field is unique against the documents in the
|
5
|
+
# database.
|
6
|
+
#
|
7
|
+
# Example:
|
8
|
+
#
|
9
|
+
# class Person
|
10
|
+
# include Mongoid::Document
|
11
|
+
# field :title
|
12
|
+
#
|
13
|
+
# validates_uniqueness_of :title
|
14
|
+
# end
|
15
|
+
#
|
16
|
+
# :in option allows to set external collection to check in
|
17
|
+
# :field option allows to set custom attribute name
|
18
|
+
#
|
19
|
+
class UniquenessValidator < ActiveModel::EachValidator
|
20
|
+
def validate_each(document, attribute, value)
|
21
|
+
if options.has_key? :field
|
22
|
+
conditions = {options[:field] => value}
|
23
|
+
else
|
24
|
+
conditions = {attribute => value}
|
25
|
+
end
|
26
|
+
|
27
|
+
conditions[options[:scope]] = document.attributes[options[:scope]] if options.has_key?(:scope) && !options[:scope].blank?
|
28
|
+
|
29
|
+
if options.has_key? :in
|
30
|
+
scope = options[:in].classify.constantize
|
31
|
+
else
|
32
|
+
scope = document.class
|
33
|
+
end
|
34
|
+
|
35
|
+
return if scope.where(conditions).empty?
|
36
|
+
|
37
|
+
if (document.new_record? || key_changed?(document)) || options.has_key?(:in)
|
38
|
+
document.errors.add(attribute, :taken, :default => options[:message], :value => value)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
protected
|
43
|
+
def key_changed?(document)
|
44
|
+
(document.primary_key || {}).each do |key|
|
45
|
+
return true if document.send("#{key}_changed?")
|
46
|
+
end; false
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Mongoid #:nodoc:
|
3
|
+
# Include this module to get automatic versioning of root level documents.
|
4
|
+
# This will add a version field to the +Document+ and a has_many association
|
5
|
+
# with all the versions contained in it.
|
6
|
+
module Versioning
|
7
|
+
extend ActiveSupport::Concern
|
8
|
+
included do
|
9
|
+
field :version, :type => Integer, :default => 1
|
10
|
+
embeds_many :versions, :class_name => self.name
|
11
|
+
set_callback :save, :before, :revise
|
12
|
+
end
|
13
|
+
module InstanceMethods
|
14
|
+
# Create a new version of the +Document+. This will load the previous
|
15
|
+
# document from the database and set it as the next version before saving
|
16
|
+
# the current document. It then increments the version number.
|
17
|
+
def revise
|
18
|
+
last_version = self.class.first(:conditions => { :_id => id, :version => version })
|
19
|
+
if last_version
|
20
|
+
self.versions << last_version.clone
|
21
|
+
self.version = version + 1
|
22
|
+
@modifications["versions"] = [ nil, @attributes["versions"] ] if @modifications
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'rails/generators/mongoid_generator'
|
3
|
+
|
4
|
+
module Mongoid
|
5
|
+
module Generators
|
6
|
+
class ConfigGenerator < Rails::Generators::Base
|
7
|
+
desc "Creates a Mongoid configuration file at config/mongoid.yml"
|
8
|
+
|
9
|
+
argument :database_name, :type => :string, :optional => true
|
10
|
+
|
11
|
+
def self.source_root
|
12
|
+
@_mongoid_source_root ||= File.expand_path("../templates", __FILE__)
|
13
|
+
end
|
14
|
+
|
15
|
+
def app_name
|
16
|
+
Rails::Application.subclasses.first.parent.to_s.underscore
|
17
|
+
end
|
18
|
+
|
19
|
+
def create_config_file
|
20
|
+
template 'mongoid.yml', File.join('config', "mongoid.yml")
|
21
|
+
end
|
22
|
+
|
23
|
+
def inject_mongoid_into_application
|
24
|
+
config_application_path = File.join("config", "application.rb")
|
25
|
+
config_contents = File.read(config_application_path)
|
26
|
+
|
27
|
+
mongoid_require = "\n\nrequire 'mongoid/railtie'"
|
28
|
+
|
29
|
+
# check to see if its already been included
|
30
|
+
return if config_contents.include?(mongoid_require)
|
31
|
+
|
32
|
+
if config_contents.include?("require 'rails/all'")
|
33
|
+
inject_into_file config_application_path, mongoid_require, :after => "require 'rails/all'"
|
34
|
+
elsif config_contents.include?("require \"action_controller/railtie\"")
|
35
|
+
inject_into_file config_application_path, mongoid_require, :after => "require \"action_controller/railtie\""
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
defaults: &defaults
|
2
|
+
host: localhost
|
3
|
+
# slaves:
|
4
|
+
# - host: slave1.local
|
5
|
+
# port: 27018
|
6
|
+
# - host: slave2.local
|
7
|
+
# port: 27019
|
8
|
+
|
9
|
+
development:
|
10
|
+
<<: *defaults
|
11
|
+
database: <%= database_name || app_name %>_development
|
12
|
+
|
13
|
+
test:
|
14
|
+
<<: *defaults
|
15
|
+
database: <%= database_name || app_name %>_test
|
16
|
+
|
17
|
+
# set these environment variables on your prod server
|
18
|
+
production:
|
19
|
+
<<: *defaults
|
20
|
+
host: <%%= ENV['MONGOID_HOST'] %>
|
21
|
+
port: <%%= ENV['MONGOID_PORT'] %>
|
22
|
+
username: <%%= ENV['MONGOID_USERNAME'] %>
|
23
|
+
password: <%%= ENV['MONGOID_PASSWORD'] %>
|
24
|
+
database: <%%= ENV['MONGOID_DATABASE'] %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "rails/generators/mongoid_generator"
|
3
|
+
|
4
|
+
module Mongoid #:nodoc:
|
5
|
+
module Generators #:nodoc:
|
6
|
+
class ModelGenerator < Base #:nodoc:
|
7
|
+
|
8
|
+
desc "Creates a Mongoid model"
|
9
|
+
argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
|
10
|
+
|
11
|
+
check_class_collision
|
12
|
+
|
13
|
+
class_option :timestamps, :type => :boolean
|
14
|
+
class_option :parent, :type => :string, :desc => "The parent class for the generated model"
|
15
|
+
class_option :versioning, :type => :boolean, :default => false, :desc => "Enable mongoid versioning"
|
16
|
+
|
17
|
+
def create_model_file
|
18
|
+
template "model.rb", File.join("app/models", class_path, "#{file_name}.rb")
|
19
|
+
end
|
20
|
+
|
21
|
+
hook_for :test_framework
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class <%= class_name %><%= " < #{options[:parent].classify}" if options[:parent] %>
|
2
|
+
<% unless options[:parent] -%>
|
3
|
+
include Mongoid::Document
|
4
|
+
<% end -%>
|
5
|
+
<% if options[:timestamps] -%>
|
6
|
+
include Mongoid::Timestamps
|
7
|
+
<% end -%>
|
8
|
+
<%= 'include Mongoid::Versioning' if options[:versioning] -%>
|
9
|
+
<% attributes.reject{|attr| attr.reference?}.each do |attribute| -%>
|
10
|
+
field :<%= attribute.name %>, :type => <%= attribute.type_class %>
|
11
|
+
<% end -%>
|
12
|
+
<% attributes.select{|attr| attr.reference? }.each do |attribute| -%>
|
13
|
+
embedded_in :<%= attribute.name%>, :inverse_of => :<%= class_name.tableize %>
|
14
|
+
<% end -%>
|
15
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "rails/generators/named_base"
|
3
|
+
require "rails/generators/active_model"
|
4
|
+
|
5
|
+
module Mongoid #:nodoc:
|
6
|
+
module Generators #:nodoc:
|
7
|
+
class Base < ::Rails::Generators::NamedBase #:nodoc:
|
8
|
+
|
9
|
+
def self.source_root
|
10
|
+
@_mongoid_source_root ||=
|
11
|
+
File.expand_path("../#{base_name}/#{generator_name}/templates", __FILE__)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class ActiveModel < ::Rails::Generators::ActiveModel #:nodoc:
|
16
|
+
def self.all(klass)
|
17
|
+
"#{klass}.all"
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.find(klass, params=nil)
|
21
|
+
"#{klass}.find(#{params})"
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.build(klass, params=nil)
|
25
|
+
if params
|
26
|
+
"#{klass}.new(#{params})"
|
27
|
+
else
|
28
|
+
"#{klass}.new"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def save
|
33
|
+
"#{name}.save"
|
34
|
+
end
|
35
|
+
|
36
|
+
def update_attributes(params=nil)
|
37
|
+
"#{name}.update_attributes(#{params})"
|
38
|
+
end
|
39
|
+
|
40
|
+
def errors
|
41
|
+
"#{name}.errors"
|
42
|
+
end
|
43
|
+
|
44
|
+
def destroy
|
45
|
+
"#{name}.destroy"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
module Rails
|
52
|
+
module Generators
|
53
|
+
class GeneratedAttribute #:nodoc:
|
54
|
+
def type_class
|
55
|
+
return "Time" if type.to_s == "datetime"
|
56
|
+
return "String" if type.to_s == "text"
|
57
|
+
return type.to_s.camelcase
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
metadata
ADDED
@@ -0,0 +1,284 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: chhean-mongoid
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: -1848230039
|
5
|
+
prerelease: true
|
6
|
+
segments:
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
- beta1
|
11
|
+
version: 2.0.1.beta1
|
12
|
+
platform: ruby
|
13
|
+
authors:
|
14
|
+
- Durran Jordan
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2010-06-04 00:00:00 -04:00
|
20
|
+
default_executable:
|
21
|
+
dependencies:
|
22
|
+
- !ruby/object:Gem::Dependency
|
23
|
+
name: activemodel
|
24
|
+
prerelease: false
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - "="
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
hash: -1848230021
|
31
|
+
segments:
|
32
|
+
- 3
|
33
|
+
- 0
|
34
|
+
- 0
|
35
|
+
- beta3
|
36
|
+
version: 3.0.0.beta3
|
37
|
+
type: :runtime
|
38
|
+
version_requirements: *id001
|
39
|
+
- !ruby/object:Gem::Dependency
|
40
|
+
name: will_paginate
|
41
|
+
prerelease: false
|
42
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - "="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
hash: 961915916
|
48
|
+
segments:
|
49
|
+
- 3
|
50
|
+
- 0
|
51
|
+
- pre
|
52
|
+
version: 3.0.pre
|
53
|
+
type: :runtime
|
54
|
+
version_requirements: *id002
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: mongo
|
57
|
+
prerelease: false
|
58
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ~>
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
hash: 21
|
64
|
+
segments:
|
65
|
+
- 1
|
66
|
+
- 0
|
67
|
+
- 1
|
68
|
+
version: 1.0.1
|
69
|
+
type: :runtime
|
70
|
+
version_requirements: *id003
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: bson
|
73
|
+
prerelease: false
|
74
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ~>
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
hash: 21
|
80
|
+
segments:
|
81
|
+
- 1
|
82
|
+
- 0
|
83
|
+
- 1
|
84
|
+
version: 1.0.1
|
85
|
+
type: :runtime
|
86
|
+
version_requirements: *id004
|
87
|
+
- !ruby/object:Gem::Dependency
|
88
|
+
name: rspec
|
89
|
+
prerelease: false
|
90
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
92
|
+
requirements:
|
93
|
+
- - "="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
hash: 62196467
|
96
|
+
segments:
|
97
|
+
- 2
|
98
|
+
- 0
|
99
|
+
- 0
|
100
|
+
- beta
|
101
|
+
- 8
|
102
|
+
version: 2.0.0.beta.8
|
103
|
+
type: :development
|
104
|
+
version_requirements: *id005
|
105
|
+
- !ruby/object:Gem::Dependency
|
106
|
+
name: mocha
|
107
|
+
prerelease: false
|
108
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
110
|
+
requirements:
|
111
|
+
- - "="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
hash: 43
|
114
|
+
segments:
|
115
|
+
- 0
|
116
|
+
- 9
|
117
|
+
- 8
|
118
|
+
version: 0.9.8
|
119
|
+
type: :development
|
120
|
+
version_requirements: *id006
|
121
|
+
description: Mongoid is an ODM (Object Document Mapper) Framework for MongoDB, written in Ruby.
|
122
|
+
email:
|
123
|
+
- durran@gmail.com
|
124
|
+
executables: []
|
125
|
+
|
126
|
+
extensions: []
|
127
|
+
|
128
|
+
extra_rdoc_files: []
|
129
|
+
|
130
|
+
files:
|
131
|
+
- lib/mongoid/associations/embedded_in.rb
|
132
|
+
- lib/mongoid/associations/embeds_many.rb
|
133
|
+
- lib/mongoid/associations/embeds_one.rb
|
134
|
+
- lib/mongoid/associations/foreign_key.rb
|
135
|
+
- lib/mongoid/associations/meta_data.rb
|
136
|
+
- lib/mongoid/associations/options.rb
|
137
|
+
- lib/mongoid/associations/proxy.rb
|
138
|
+
- lib/mongoid/associations/referenced_in.rb
|
139
|
+
- lib/mongoid/associations/references_many.rb
|
140
|
+
- lib/mongoid/associations/references_many_as_array.rb
|
141
|
+
- lib/mongoid/associations/references_one.rb
|
142
|
+
- lib/mongoid/associations.rb
|
143
|
+
- lib/mongoid/attributes.rb
|
144
|
+
- lib/mongoid/callbacks.rb
|
145
|
+
- lib/mongoid/collection.rb
|
146
|
+
- lib/mongoid/collections/cyclic_iterator.rb
|
147
|
+
- lib/mongoid/collections/master.rb
|
148
|
+
- lib/mongoid/collections/operations.rb
|
149
|
+
- lib/mongoid/collections/slaves.rb
|
150
|
+
- lib/mongoid/collections.rb
|
151
|
+
- lib/mongoid/components.rb
|
152
|
+
- lib/mongoid/config.rb
|
153
|
+
- lib/mongoid/contexts/enumerable.rb
|
154
|
+
- lib/mongoid/contexts/ids.rb
|
155
|
+
- lib/mongoid/contexts/mongo.rb
|
156
|
+
- lib/mongoid/contexts/paging.rb
|
157
|
+
- lib/mongoid/contexts.rb
|
158
|
+
- lib/mongoid/criteria.rb
|
159
|
+
- lib/mongoid/criterion/complex.rb
|
160
|
+
- lib/mongoid/criterion/exclusion.rb
|
161
|
+
- lib/mongoid/criterion/inclusion.rb
|
162
|
+
- lib/mongoid/criterion/optional.rb
|
163
|
+
- lib/mongoid/cursor.rb
|
164
|
+
- lib/mongoid/deprecation.rb
|
165
|
+
- lib/mongoid/dirty.rb
|
166
|
+
- lib/mongoid/document.rb
|
167
|
+
- lib/mongoid/errors.rb
|
168
|
+
- lib/mongoid/extensions/array/accessors.rb
|
169
|
+
- lib/mongoid/extensions/array/aliasing.rb
|
170
|
+
- lib/mongoid/extensions/array/assimilation.rb
|
171
|
+
- lib/mongoid/extensions/array/conversions.rb
|
172
|
+
- lib/mongoid/extensions/array/parentization.rb
|
173
|
+
- lib/mongoid/extensions/big_decimal/conversions.rb
|
174
|
+
- lib/mongoid/extensions/binary/conversions.rb
|
175
|
+
- lib/mongoid/extensions/boolean/conversions.rb
|
176
|
+
- lib/mongoid/extensions/date/conversions.rb
|
177
|
+
- lib/mongoid/extensions/datetime/conversions.rb
|
178
|
+
- lib/mongoid/extensions/float/conversions.rb
|
179
|
+
- lib/mongoid/extensions/hash/accessors.rb
|
180
|
+
- lib/mongoid/extensions/hash/assimilation.rb
|
181
|
+
- lib/mongoid/extensions/hash/conversions.rb
|
182
|
+
- lib/mongoid/extensions/hash/criteria_helpers.rb
|
183
|
+
- lib/mongoid/extensions/hash/scoping.rb
|
184
|
+
- lib/mongoid/extensions/integer/conversions.rb
|
185
|
+
- lib/mongoid/extensions/nil/assimilation.rb
|
186
|
+
- lib/mongoid/extensions/object/conversions.rb
|
187
|
+
- lib/mongoid/extensions/objectid/conversions.rb
|
188
|
+
- lib/mongoid/extensions/proc/scoping.rb
|
189
|
+
- lib/mongoid/extensions/set/conversions.rb
|
190
|
+
- lib/mongoid/extensions/string/conversions.rb
|
191
|
+
- lib/mongoid/extensions/string/inflections.rb
|
192
|
+
- lib/mongoid/extensions/symbol/inflections.rb
|
193
|
+
- lib/mongoid/extensions/time_conversions.rb
|
194
|
+
- lib/mongoid/extensions.rb
|
195
|
+
- lib/mongoid/extras.rb
|
196
|
+
- lib/mongoid/factory.rb
|
197
|
+
- lib/mongoid/field.rb
|
198
|
+
- lib/mongoid/fields.rb
|
199
|
+
- lib/mongoid/finders.rb
|
200
|
+
- lib/mongoid/identity.rb
|
201
|
+
- lib/mongoid/indexes.rb
|
202
|
+
- lib/mongoid/javascript/functions.yml
|
203
|
+
- lib/mongoid/javascript.rb
|
204
|
+
- lib/mongoid/matchers/all.rb
|
205
|
+
- lib/mongoid/matchers/default.rb
|
206
|
+
- lib/mongoid/matchers/exists.rb
|
207
|
+
- lib/mongoid/matchers/gt.rb
|
208
|
+
- lib/mongoid/matchers/gte.rb
|
209
|
+
- lib/mongoid/matchers/in.rb
|
210
|
+
- lib/mongoid/matchers/lt.rb
|
211
|
+
- lib/mongoid/matchers/lte.rb
|
212
|
+
- lib/mongoid/matchers/ne.rb
|
213
|
+
- lib/mongoid/matchers/nin.rb
|
214
|
+
- lib/mongoid/matchers/size.rb
|
215
|
+
- lib/mongoid/matchers.rb
|
216
|
+
- lib/mongoid/memoization.rb
|
217
|
+
- lib/mongoid/named_scope.rb
|
218
|
+
- lib/mongoid/observable.rb
|
219
|
+
- lib/mongoid/paths.rb
|
220
|
+
- lib/mongoid/persistence/command.rb
|
221
|
+
- lib/mongoid/persistence/insert.rb
|
222
|
+
- lib/mongoid/persistence/insert_embedded.rb
|
223
|
+
- lib/mongoid/persistence/remove.rb
|
224
|
+
- lib/mongoid/persistence/remove_all.rb
|
225
|
+
- lib/mongoid/persistence/remove_embedded.rb
|
226
|
+
- lib/mongoid/persistence/update.rb
|
227
|
+
- lib/mongoid/persistence.rb
|
228
|
+
- lib/mongoid/railtie.rb
|
229
|
+
- lib/mongoid/railties/database.rake
|
230
|
+
- lib/mongoid/scope.rb
|
231
|
+
- lib/mongoid/state.rb
|
232
|
+
- lib/mongoid/timestamps.rb
|
233
|
+
- lib/mongoid/validations/associated.rb
|
234
|
+
- lib/mongoid/validations/locale/en.yml
|
235
|
+
- lib/mongoid/validations/uniqueness.rb
|
236
|
+
- lib/mongoid/validations.rb
|
237
|
+
- lib/mongoid/version.rb
|
238
|
+
- lib/mongoid/versioning.rb
|
239
|
+
- lib/mongoid.rb
|
240
|
+
- lib/rails/generators/mongoid/config/config_generator.rb
|
241
|
+
- lib/rails/generators/mongoid/config/templates/mongoid.yml
|
242
|
+
- lib/rails/generators/mongoid/model/model_generator.rb
|
243
|
+
- lib/rails/generators/mongoid/model/templates/model.rb
|
244
|
+
- lib/rails/generators/mongoid_generator.rb
|
245
|
+
- MIT_LICENSE
|
246
|
+
- README.rdoc
|
247
|
+
has_rdoc: true
|
248
|
+
homepage: http://mongoid.org
|
249
|
+
licenses: []
|
250
|
+
|
251
|
+
post_install_message:
|
252
|
+
rdoc_options: []
|
253
|
+
|
254
|
+
require_paths:
|
255
|
+
- lib
|
256
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
257
|
+
none: false
|
258
|
+
requirements:
|
259
|
+
- - ">="
|
260
|
+
- !ruby/object:Gem::Version
|
261
|
+
hash: 3
|
262
|
+
segments:
|
263
|
+
- 0
|
264
|
+
version: "0"
|
265
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
266
|
+
none: false
|
267
|
+
requirements:
|
268
|
+
- - ">="
|
269
|
+
- !ruby/object:Gem::Version
|
270
|
+
hash: 23
|
271
|
+
segments:
|
272
|
+
- 1
|
273
|
+
- 3
|
274
|
+
- 6
|
275
|
+
version: 1.3.6
|
276
|
+
requirements: []
|
277
|
+
|
278
|
+
rubyforge_project: mongoid
|
279
|
+
rubygems_version: 1.3.7
|
280
|
+
signing_key:
|
281
|
+
specification_version: 3
|
282
|
+
summary: Elegent Persistance in Ruby for MongoDB.
|
283
|
+
test_files: []
|
284
|
+
|