Permalink
Commits on May 30, 2011
  1. resolve conflict

    committed May 30, 2011
  2. merged upstream

    committed May 30, 2011
  3. removed trailing whitespaces

    etehtsea committed with May 27, 2011
  4. Adding in warning for use of slave databases - replica sets should be…

    … used from now on.
    durran committed with May 22, 2011
  5. Bumping version to 2.0.2

    durran committed with May 22, 2011
  6. Allowing Criteria#only and Criteria#without to work within named scopes:

    - 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.
    durran committed with May 19, 2011
  7. Updating rspec to over 2.6

    durran committed with May 19, 2011
  8. Update to latest and greatest generated rvmrc

    Paul Elliott committed with May 18, 2011
  9. Add Mongoid::Field.option for custom field options

    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
    bernerdschaefer committed with May 12, 2011
  10. Minor spec updates

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

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

    - 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.
    durran committed with May 11, 2011
  13. Refactoring the observer spec

    durran committed with May 10, 2011
  14. Slight reworking of the way the factory instantiates documents:

    - 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.
    durran committed with May 9, 2011
  15. As far as attributes are concerned, we consume our own API internally:

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

    - This is consistent with AR in that all keys in the attributes hash are
      strings.
    - Document#raw_attributes will still return the same hash.
    durran committed with May 5, 2011
  17. Fix typo in russian localization

    avsej committed with May 2, 2011
  18. Removing extra whitespace

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

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

    …during updates
    Chase Martyn committed with Apr 25, 2011
  21. Forcing tests to use Syck YAML parser and reorganise app generated co…

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

    …ck YAML parser (app only, tests rely on syck)
    KieranP committed with Apr 23, 2011
  23. Fixing test whitespace

    KieranP committed with Apr 23, 2011