From 2f366ea631d6177964acb8b7d7c0c20d48501a16 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Sun, 27 May 2012 14:46:12 +0200 Subject: [PATCH] Removing todos --- lib/mongoid/atomic.rb | 3 --- lib/mongoid/config.rb | 2 -- lib/mongoid/contextual/mongo.rb | 4 ---- lib/mongoid/dirty.rb | 21 ++++++--------------- lib/mongoid/relations/nested_builder.rb | 2 -- lib/mongoid/relations/synchronization.rb | 2 -- 6 files changed, 6 insertions(+), 28 deletions(-) diff --git a/lib/mongoid/atomic.rb b/lib/mongoid/atomic.rb index 33cc9b6845..15a0d358e0 100644 --- a/lib/mongoid/atomic.rb +++ b/lib/mongoid/atomic.rb @@ -262,9 +262,6 @@ def delayed_atomic_pulls # @example Get the atomic paths. # document.atomic_paths # - # @todo: Durran: Should probably raise error for embedded docs w/o - # metadata. - # # @return [ Object ] The associated path. # # @since 2.1.0 diff --git a/lib/mongoid/config.rb b/lib/mongoid/config.rb index 847246b295..43f490c109 100644 --- a/lib/mongoid/config.rb +++ b/lib/mongoid/config.rb @@ -73,8 +73,6 @@ def connect_to(name) # Purge all data in all collections, including indexes. # - # @todo Durran: clean up. - # # @example Purge all data. # Mongoid::Config.purge! # diff --git a/lib/mongoid/contextual/mongo.rb b/lib/mongoid/contextual/mongo.rb index e231d63899..c0c3d97394 100644 --- a/lib/mongoid/contextual/mongo.rb +++ b/lib/mongoid/contextual/mongo.rb @@ -378,8 +378,6 @@ def apply_limit # Map the sort symbols to the correct MongoDB values. # - # @todo: Durran: Temporary. - # # @example Apply the sorting params. # context.apply_sorting # @@ -392,8 +390,6 @@ def apply_sorting # Map the inverse sort symbols to the correct MongoDB values. # - # @todo: Durran: Temporary. - # # @example Apply the inverse sorting params. # context.apply_inverse_sorting # diff --git a/lib/mongoid/dirty.rb b/lib/mongoid/dirty.rb index bcce577ffc..5dff2ebc15 100644 --- a/lib/mongoid/dirty.rb +++ b/lib/mongoid/dirty.rb @@ -127,38 +127,29 @@ def remove_change(name) # Gets all the new values for each of the changed fields, to be passed to # a MongoDB $set modifier. # - # @todo: Durran: Refactor 3.0 - # # @example Get the setters for the atomic updates. # person = Person.new(:title => "Sir") # person.title = "Madam" # person.setters # returns { "title" => "Madam" } # # @return [ Hash ] A +Hash+ of atomic setters. + # + # @since 2.0.0 def setters - modifications = {} + mods = {} changes.each_pair do |name, changes| if changes old, new = changes field = fields[name] key = atomic_attribute_name(name) if field && field.resizable? - field.add_atomic_changes( - self, - name, - key, - modifications, - new, - old - ) + field.add_atomic_changes(self, name, key, mods, new, old) else - unless atomic_unsets.include?(key) - modifications[key] = new - end + mods[key] = new unless atomic_unsets.include?(key) end end end - modifications + mods end private diff --git a/lib/mongoid/relations/nested_builder.rb b/lib/mongoid/relations/nested_builder.rb index d9a9721e46..7a20d2a905 100644 --- a/lib/mongoid/relations/nested_builder.rb +++ b/lib/mongoid/relations/nested_builder.rb @@ -57,8 +57,6 @@ def update_only? # Convert an id to its appropriate type. # - # @todo Durran: Move this into a common reusable place. - # # @example Convert the id. # builder.convert_id(Person, "4d371b444835d98b8b000010") # diff --git a/lib/mongoid/relations/synchronization.rb b/lib/mongoid/relations/synchronization.rb index 38dcfb09d7..7892eb95eb 100644 --- a/lib/mongoid/relations/synchronization.rb +++ b/lib/mongoid/relations/synchronization.rb @@ -36,8 +36,6 @@ def synced # Has the document been synced for the foreign key? # - # @todo Change the sync to be key based. - # # @example Has the document been synced? # document.synced? #