Skip to content
Commits on Jul 29, 2010
  1. @durran

    Updating version to beta 15

    Durran Jordan and Les Hill and Paul Elliott and Tim Pope committed with durran Jul 29, 2010
  2. @durran

    Changing index rake task not to use the module descendents method

    Durran Jordan and Les Hill and Paul Elliott and Tim Pope committed with durran Jul 29, 2010
  3. @durran

    Fixing the memory faucet:

    - Notes for people submitting patches in the future: Please do
      not use class variables... Very, very bad.
    Durran Jordan and Les Hill and Paul Elliott and Tim Pope committed with durran Jul 29, 2010
  4. @jacquescrocker

    Minor doc fix

    jacquescrocker committed Jul 29, 2010
  5. @emk @jacquescrocker

    Allow referenced_in association to be nil

    Until a few days ago, Mongoid supported objects which were optionally
    referenced_in a parent object's references_many, but which could also
    stand on their own.  Recently, this has stopped working, and started
    generating errors about an object with an id of 4.
    
        Failure/Error: @account.creator.should be_nil
        Document not found for class User with id(s) 4
        # ./spec/../lib/mongoid/contexts/ids.rb:19:in `id_criteria'
        # ./spec/../lib/mongoid/criteria.rb:31:in `__send__'
        # ./spec/../lib/mongoid/criteria.rb:31:in `id_criteria'
        # ./spec/../lib/mongoid/criteria.rb:189:in `translate'
        # ./spec/../lib/mongoid/finders.rb:68:in `find'
        # ./spec/../lib/mongoid/associations/referenced_in.rb:21:in `initialize'
        # ./spec/../lib/mongoid/associations.rb:280:in `new'
        # ./spec/../lib/mongoid/associations.rb:280:in `creator'
        # ./spec/../lib/mongoid/memoization.rb:11:in `memoized'
        # ./spec/../lib/mongoid/associations.rb:279:in `creator'
        # ./spec/integration/mongoid/associations_spec.rb:224
    
    These errors are caused by the following two lines of code in
    Association's update_foreign_keys method:
    
        target = send(name)
        send("#{foreign_key}=", target ? target.id : nil)
    
    This code is manipulating proxy objects, which don't do the expected
    thing when evaluated in a conditional statement:
    
        class ExampleProxy < Mongoid::Associations::Proxy
          def initialize(target)
            @target = target
          end
        end
    
        proxy = ExampleProxy.new(nil)
        proxy.nil? => false
        (proxy ? true : false) => true
    
    According to folks on the ruby IRC channel, there's no way to make a
    proxy object reliably behave like nil when used in a conditional
    expression.
    
    If we make the use of proxies explicit in this code, then all the unit
    tests pass and we stop accidentally storing 4 (the id of nil!) in the
    database.
    
        proxy = send(name)
        send("#{foreign_key}=", proxy && proxy.target ? proxy.id : nil)
    
    There's an analogous use of proxy.target in the associate method:
    
        proxy.target ? proxy : nil
    
    ...so this behavior is consistent with other code in Mongoid.
    emk committed with jacquescrocker Jul 29, 2010
  6. @durran

    Fixing broken specs.

    - ObjectID#as_json should always override.
    - Criteria integration spec got in merge trouble, reverted
      to correct version.
    durran committed Jul 28, 2010
  7. @jacquescrocker
  8. @jacquescrocker
  9. @durran

    Finishing basic dependent => destroy|delete options on relational

    associations. Fixes #135.
    
    Current available options:
    
    - references_many :name, :dependent => :destroy
    - references_one :name, :dependent => :delete
    
    We can expand this later if need be if we need more
    functionality around this.
    durran committed Jul 28, 2010
  10. @jacquescrocker
  11. @durran
Commits on Jul 28, 2010
  1. @paulrosania @durran

    Remove null object from has-one relationships. Closes #149.

    This patch removes the ability to call #association.build for references_one
    relationships.  Instead, it offers #build_association similar to Active Record.
    As a result this patch may break applications that relied on that functionality.
    paulrosania committed with durran Jun 24, 2010
  2. @durran
  3. @durran
  4. @durran
Commits on Jul 27, 2010
  1. @durran
  2. @durran

    Removing accessible option from field as we now have attr_protected a…

    …nd attr_accessible
    durran committed Jul 27, 2010
  3. @durran

    Removing whitespace

    durran committed Jul 27, 2010
  4. @durran

    Updating gemfile so as not to get errors

    Durran Jordan committed with durran Jul 15, 2010
  5. @paulrosania @durran

    Use ActiveModel::MassAssignmentSecurity for attr_accessible, attr_pro…

    …tected
    
    This patch requires ActiveModel edge, revision 4b66aab0 or later.
    paulrosania committed with durran Jul 12, 2010
  6. @durran
  7. @durran

    Adding .rvmrc to .gitignore

    durran committed Jul 27, 2010
  8. @durran
  9. Fix nested_build with references_many

    [Resolves github issue #211]
    Bernerd Schaefer and Veezus Kreist committed with Pairing Workstation Hancock Jul 27, 2010
  10. Run callbacks once for embedded documents

    Bernerd Schaefer and Veezus Kreist committed with Pairing Workstation Hancock Jul 27, 2010
  11. Use write_attribute instead of setter

    Bernerd Schaefer and Veezus Kreist committed with Pairing Workstation Hancock Jul 27, 2010
  12. Remove unnecessary class-level spec variables

    Bernerd Schaefer and Veezus Kreist committed with Pairing Workstation Hancock Jul 27, 2010
  13. Update rake_rubies to work with latest rvm

    Bernerd Schaefer and Veezus Kreist committed with Pairing Workstation Hancock Jul 27, 2010
  14. Add spec:progress task

    Bernerd Schaefer and Veezus Kreist committed with Pairing Workstation Hancock Jul 27, 2010
  15. @durran

    Updating shel script yet again

    durran committed Jul 27, 2010
  16. @durran
  17. @durran
  18. @durran

    Bumping to active model rc

    durran committed Jul 27, 2010
  19. @durran

    Bumping version again

    durran committed Jul 26, 2010
Commits on Jul 26, 2010
  1. @durran

    Updating README

    durran committed Jul 26, 2010
Something went wrong with that request. Please try again.