Permalink
Commits on May 22, 2011
  1. Bumping version to 2.0.2

    durran committed May 22, 2011
Commits on May 19, 2011
  1. Allowing Criteria#only and Criteria#without to work within named scopes:

    durran committed May 19, 2011
    - When fusing the criteria through scopes it was passing through method
      missing on the criteria to the class on #fields, getting a
      not-so-obvious wrong number of arguments error. This is now resolved.
  2. Updating rspec to over 2.6

    durran committed May 19, 2011
Commits on May 18, 2011
  1. Update to latest and greatest generated rvmrc

    Paul Elliott committed May 18, 2011
Commits on May 12, 2011
  1. Merge pull request #917 from sserdyuk/master

    durran committed May 12, 2011
    Fix for a ruby 1.9 compatibility bug in dirty.rb
  2. Merge pull request #921 from bernerdschaefer/custom-field-options

    durran committed May 12, 2011
    Add Mongoid::Field.option for custom field options
  3. Merge pull request #916 from bernerdschaefer/master

    durran committed May 12, 2011
    Minor tweaks to Mongoid::Paranoia
  4. Add Mongoid::Field.option for custom field options

    bernerdschaefer committed May 12, 2011
    This allows users of Mongoid to define custom field options, and execute
    handlers when that option is provided.
    
    A few use-cases spring to mind:
    
    1. Auto-validations
    
    It should be (fairly) trivial to implement field-level validations like
    DataMapper and ActiveRecord, with the most trivial example looking
    something like this.
    
        Mongoid::Field.option :required do |model, field, required|
          model.validates_presence_of field.name if required
        end
    
    Now the block will be executed whenever a field is defined that includes
    the key `:required` in its options:
    
        Person.field :name, required: true
        Person.field :age, required: false
    
    All options provided are still stored on the Field, which should also
    allow for a richer level of introspection:
    
        class Person
          def required_fields
            fields.select { |field| field.options[:required] }
          end
        end
    
    2. Mass Assignment
    
        Mongoid::Field.option :accessible do |model, field, accessible|
          model.attr_accessible field.name if accessible
        end
    
    3. Re-writing option values, and other uses
    
        # Turn :alias => :city into :alias => [:city]
        Mongoid::Field.option :alias do |model, field|
          field.options[:aliases] = [*field.options.delete(:alias)]
        end
    
        Mongoid::Field.option :aliases do |model, field, aliases|
          aliases.each do |new_name|
            model.alias_attribute new_name, field.name
          end
        end
Commits on May 11, 2011
  1. Minor spec updates

    sserdyuk committed May 11, 2011
  2. Fixes ruby 1.9 compatibility bug where ::instance_methods was only ch…

    sserdyuk committed May 11, 2011
    …ecked with string values and resulted existing methods overwritten with mongoid 'dirty' helper methods
  3. Fixing update_attribute performance when same value provided:

    durran committed May 11, 2011
    - There is no need to attempt to go through the save chain when the
      attribute has not changed. The previous change to this had killed
      performance in that situation, this commit restores it.
Commits on May 10, 2011
  1. Refactoring the observer spec

    durran committed May 10, 2011
Commits on May 9, 2011
  1. Slight reworking of the way the factory instantiates documents:

    durran committed May 9, 2011
    - The builders and creators now call the factory directory.
    - The relation builders no longer handle hash input.
    - Instantiating documents from the db without ids does not generate new
      ones. Fixes #518.
Commits on May 5, 2011
  1. As far as attributes are concerned, we consume our own API internally:

    durran committed May 5, 2011
    - Slap on the wrist to me for not adhering to this basic OO principle
      earlier. Need to make sure the entire codebase does this.
  2. Document#attributes no longer returns a HashWithIndifferentAccess:

    durran committed May 5, 2011
    - This is consistent with AR in that all keys in the attributes hash are
      strings.
    - Document#raw_attributes will still return the same hash.
  3. Merge pull request #887 from romanbsd/master

    durran committed May 5, 2011
    Access attributes using a method, allows attributes overriding.
Commits on May 3, 2011
  1. Merge pull request #897 from avsej/patch-1.

    etehtsea committed May 3, 2011
    Fix typo in russian localization
Commits on May 2, 2011
  1. Fix typo in russian localization

    avsej committed May 2, 2011
Commits on Apr 26, 2011
Commits on Apr 25, 2011
  1. Removing extra whitespace

    KieranP committed Apr 25, 2011
  2. adding tests to ensure persistence methods return false when callback…

    Chase Martyn committed with KieranP Apr 25, 2011
    …s return false
  3. adding code and spec to fix blindness to callbacks that return false …

    Chase Martyn committed with KieranP Apr 25, 2011
    …during updates
Commits on Apr 24, 2011
  1. Merge branch 'observers-rails31' of https://github.com/cgriego/mongoid

    etehtsea committed Apr 24, 2011
    …into cgriego-observers-rails31
Commits on Apr 23, 2011
  1. Forcing tests to use Syck YAML parser and reorganise app generated co…

    KieranP committed Apr 23, 2011
    …nfiguration file contents
  2. Mongoid should generate a YAML file compatible with both Psych and Sy…

    KieranP committed Apr 23, 2011
    …ck YAML parser (app only, tests rely on syck)