Permalink
Commits on Sep 30, 2009
  1. Updated History

    dkubb committed Sep 30, 2009
  2. Fixed comparison that fails on Ruby 1.8.6

    dkubb committed Sep 30, 2009
    * In 1.8.7 and 1.9.1 Hash#eql? works so that {}.eql?({}) == true,
      but in 1.8.6 it returns false.  Updated the specs to use Hash#==.
Commits on Sep 29, 2009
Commits on Sep 28, 2009
  1. Removed redundant comments

    dkubb committed Sep 28, 2009
  2. Minor README cleanups

    dkubb committed Sep 28, 2009
  3. Simplified Relationship inheritance by subclasses

    dkubb committed Sep 28, 2009
    * Fixed bug where SEL and STI would not work together if the
      sources were from sibling classes
    * Added failing specs for SEL w/STI subclasses
    * Updated Property inheritance to use similar logic for consistency
    
    [#1045 state:resolved]
  4. Simplified SELECT query generation

    dkubb committed Sep 26, 2009
    * Removed optimization where ORDER BY and LIMIT are removed if there
      WHERE clause can only match one unique record.  This was unecessary
      and would be handled by any decent RDBMS anyway.
    
      More importantly, this feature was incorrect.  If a CPK was defined,
      but only one property in the CPK was being used, it would filter out
      the ORDER BY and LIMIT, and cause incorrect results to be returned.
    
      If this feature ever does return (unlikely) it will be implemented
      as an optimization performed in the Query layer, and not inside
      the adapter.
Commits on Sep 27, 2009
  1. Ensure the correct ordering of links for more complex joins

    dbussink committed Sep 27, 2009
    Consider a query like the following:
    
    Person.all(Person.memberships.group.type => 'cool', Person.memberships.valid_from.gte => Date.today)
    
    This can result in one of the following to link lists being set up (depending on non-deterministic
    hash ordering).
    
    [:memberships, :group, :memberships]
    [:group, :memberships, :memberships]
    
    Query#normalize_links walks through this list and creates the following structure:
    
    [:memberships, :group] or [:group, :memberships]
    
    If the first situation happens and the subsequent join statement is created, it will
    create an invalid join statement. DataObjectsAdapter#join_statement walks through
    the normalized list in revere order, so if that adds group to the query before
    memberships in a join, the query will fail.
    
    The fix is very simple. Because of how the initial list is constructed, a correctly
    normalized list will be created by walking the initial 3 element list given above in the
    reverse order. That will always result in the [:group, :memberships] links that
    will work correctly if joined in reverse order
Commits on Sep 23, 2009
  1. Replaced usage of base64 lib with pack/unpack

    dkubb committed Sep 23, 2009
    * Ruby 1.9 doesn't have a base64 library anymore, but pack/unpack can
      be used to base 64 encode strings.  This change is backwards compatible
      with Ruby 1.8.6 and 1.8.7
Commits on Sep 21, 2009
  1. Fixed minor documentation spelling mistake

    shingara committed with dkubb Sep 21, 2009
    Signed-off-by: Dan Kubb <dan.kubb@gmail.com>
  2. Bumped version to 0.10.1

    dkubb committed Sep 21, 2009
    * Updated gem dependencies
  3. Fixed release date mistake

    dkubb committed Sep 21, 2009
  4. Updated ManyToMany::Collection#intermediaries to be public

    dkubb committed Sep 21, 2009
    * Refactored ManyToMany::Collection#intermediaries internals to cache
      the results, so that repeated uses of intermediaries will not hit
      the adapter more than once.
    * Removing an m:m intermediary will now also delete the resource from the
      ManyToMany::Collection#intermediaries collection.  This was necessary
      due to the fact that the collection is now cached, and not computed
      on the fly.
    * Updated OneToMany::Collection#_save to only save the removed Resource
      if it wasn't already destroyed.
  5. Added Resource#destroyed?

    dkubb committed Sep 21, 2009
    * Updated Resource#destroy to return true if the resource was
      destroyed.  Multiple calls to destroy will now always return true.
Commits on Sep 19, 2009
  1. Refactored @conditions in Query to be NullOperation

    dkubb committed Sep 18, 2009
    * Refactored @conditions appending to Query#add_condition
    * Updated AbstractOperation instances to only be valid if they
      have any operands.
    * Optimized Query#match_records to return all the records if the
      conditions are nil
  2. Added NullOperation null object

    dkubb committed Sep 18, 2009
    * This will be used as the default operation in a Query.  It is valid,
      matches every resource, and behaves similarly to nil.
  3. Revert "DataObjectsAdapter#operation_statement should ignore empty An…

    dkubb committed Sep 19, 2009
    …dOperations and OrOperations in the operands of a parent AndOperation or OrOperation (e.g. OR{column1=~/taco/; AND(column2>0; column3 == "syphon"); AND()})"
    
    This reverts commit b6b93c6.
    
    * Better handled with a null object, and flagging empty operations
      as invalid
  4. Revert "Altering DataObjectsAdapter w/ a patch suggested by dkubb sin…

    dkubb committed Sep 19, 2009
    …ce my last change, made the DOA, er... DOA on 1.9."
    
    This reverts commit d7655eb.
    
    * Null object handles this case even more efficiently
  5. DRYed up equality and equivalency methods with DataMapper::Equalizer

    dkubb committed Sep 15, 2009
    * Most #eql? and #== methods followed a common pattern, so moved the
      logic into a shared module.
  6. Simplified comparison methods

    dkubb committed Sep 12, 2009
  7. Updated Collection#pop and Collection#shift to pass arguments to Array

    dkubb committed Sep 10, 2009
    * On Ruby 1.8.7+ this will allow you to pop and shift more than 1
      entry off the collection
    
    [#1032 state:resolved]
Commits on Sep 18, 2009
  1. Making {"title.like" => "Star Wars%"} behave like {:title.like => "St…

    Ted Han committed Sep 18, 2009
    …ar Wars%"}. String conditions now can have condition slugs applied to them just the same way symbols can.
  2. Altering DataObjectsAdapter w/ a patch suggested by dkubb since my la…

    Ted Han committed Sep 18, 2009
    …st change, made the DOA, er... DOA on 1.9.
Commits on Sep 16, 2009
  1. DataObjectsAdapter#operation_statement should ignore empty AndOperati…

    Ted Han committed Sep 16, 2009
    …ons and OrOperations in the operands of a parent AndOperation or OrOperation (e.g. OR{column1=~/taco/; AND(column2>0; column3 == "syphon"); AND()})