Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Jul 29, 2010
  1. @durran

    Updating version to beta 15

    Durran Jordan and Les Hill and Paul Elliott and Tim Pope authored durran committed
  2. @durran

    Changing index rake task not to use the module descendents method

    Durran Jordan and Les Hill and Paul Elliott and Tim Pope authored durran committed
  3. @durran

    Fixing the memory faucet:

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

    Minor doc fix

    railsjedi authored
  5. @emk @railsjedi

    Allow referenced_in association to be nil

    emk authored railsjedi committed
    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.
  6. @durran

    Fixing broken specs.

    durran authored
    - ObjectID#as_json should always override.
    - Criteria integration spec got in merge trouble, reverted
      to correct version.
  7. @railsjedi
  8. @railsjedi
  9. @durran

    Finishing basic dependent => destroy|delete options on relational

    durran authored
    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.
  10. @railsjedi
  11. @durran
Commits on Jul 28, 2010
  1. @paulrosania @durran

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

    paulrosania authored durran committed
    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.
  2. @durran
  3. @durran
  4. @durran
Commits on Jul 27, 2010
  1. @durran
  2. @durran
  3. @durran

    Removing whitespace

    durran authored
  4. @durran

    Updating gemfile so as not to get errors

    Durran Jordan authored durran committed
  5. @paulrosania @durran

    Use ActiveModel::MassAssignmentSecurity for attr_accessible, attr_pro…

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

    Adding .rvmrc to .gitignore

    durran authored
  8. @durran
  9. Fix nested_build with references_many

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

    Bernerd Schaefer and Veezus Kreist authored Pairing Workstation Hancock committed
  11. Use write_attribute instead of setter

    Bernerd Schaefer and Veezus Kreist authored Pairing Workstation Hancock committed
  12. Remove unnecessary class-level spec variables

    Bernerd Schaefer and Veezus Kreist authored Pairing Workstation Hancock committed
  13. Update rake_rubies to work with latest rvm

    Bernerd Schaefer and Veezus Kreist authored Pairing Workstation Hancock committed
  14. Add spec:progress task

    Bernerd Schaefer and Veezus Kreist authored Pairing Workstation Hancock committed
  15. @durran

    Updating shel script yet again

    durran authored
  16. @durran
  17. @durran
  18. @durran

    Bumping to active model rc

    durran authored
  19. @durran

    Bumping version again

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

    Updating README

    durran authored
Something went wrong with that request. Please try again.