Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on May 22, 2011
  1. @durran

    Bumping version to 2.0.2

    durran authored
Commits on May 19, 2011
  1. @durran
  2. @durran

    Allowing Criteria#only and Criteria#without to work within named scopes:

    durran authored
    - 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.
  3. @durran

    Updating rspec to over 2.6

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

    Paul Elliott authored
Commits on May 12, 2011
  1. @durran

    Merge pull request #917 from sserdyuk/master

    durran authored
    Fix for a ruby 1.9 compatibility bug in dirty.rb
  2. @durran

    Merge pull request #921 from bernerdschaefer/custom-field-options

    durran authored
    Add Mongoid::Field.option for custom field options
  3. @durran

    Merge pull request #916 from bernerdschaefer/master

    durran authored
    Minor tweaks to Mongoid::Paranoia
  4. @bernerdschaefer

    Add Mongoid::Field.option for custom field options

    bernerdschaefer authored
    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
  5. @bernerdschaefer
Commits on May 11, 2011
  1. @sserdyuk

    Minor spec updates

    sserdyuk authored
  2. @sserdyuk

    Fixes ruby 1.9 compatibility bug where ::instance_methods was only ch…

    sserdyuk authored
    …ecked with string values and resulted existing methods overwritten with mongoid 'dirty' helper methods
  3. @durran

    Fixing update_attribute performance when same value provided:

    durran authored
    - 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. @durran

    Refactoring the observer spec

    durran authored
  2. @bernerdschaefer
  3. @bernerdschaefer
Commits on May 9, 2011
  1. @durran
  2. @durran
  3. @durran

    Slight reworking of the way the factory instantiates documents:

    durran authored
    - 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.
  4. @durran
  5. @durran
Commits on May 5, 2011
  1. @durran
  2. @durran

    As far as attributes are concerned, we consume our own API internally:

    durran authored
    - Slap on the wrist to me for not adhering to this basic OO principle
      earlier. Need to make sure the entire codebase does this.
  3. @durran

    Document#attributes no longer returns a HashWithIndifferentAccess:

    durran authored
    - This is consistent with AR in that all keys in the attributes hash are
      strings.
    - Document#raw_attributes will still return the same hash.
  4. @durran

    Merge pull request #887 from romanbsd/master

    durran authored
    Access attributes using a method, allows attributes overriding.
Commits on May 3, 2011
  1. @etehtsea

    Merge pull request #897 from avsej/patch-1.

    etehtsea authored
    Fix typo in russian localization
Commits on May 2, 2011
  1. @avsej
Commits on Apr 26, 2011
  1. @romanbsd
Commits on Apr 25, 2011
  1. @KieranP

    Removing extra whitespace

    KieranP authored
  2. @cmartyn @KieranP

    fixing permissions on scripts files

    cmartyn authored KieranP committed
  3. @KieranP

    adding tests to ensure persistence methods return false when callback…

    Chase Martyn authored KieranP committed
    …s return false
  4. @KieranP

    adding code and spec to fix blindness to callbacks that return false …

    Chase Martyn authored KieranP committed
    …during updates
Commits on Apr 24, 2011
  1. @etehtsea

    Merge branch 'observers-rails31' of https://github.com/cgriego/mongoid

    etehtsea authored
    …into cgriego-observers-rails31
Commits on Apr 23, 2011
  1. @KieranP

    Forcing tests to use Syck YAML parser and reorganise app generated co…

    KieranP authored
    …nfiguration file contents
  2. @KieranP

    Mongoid should generate a YAML file compatible with both Psych and Sy…

    KieranP authored
    …ck YAML parser (app only, tests rely on syck)
Something went wrong with that request. Please try again.