Permalink
Browse files

Added default options to delete_all

  • Loading branch information...
1 parent 58fb4b4 commit 34500c158d2fd6679fa48d3d718c14a1396e7143 @treeder treeder committed Apr 7, 2011
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/simple_record.rb
  2. +1 −1 lib/simple_record/sharding.rb
View
4 lib/simple_record.rb
@@ -810,7 +810,7 @@ def self.delete(id)
end
# Pass in the same OPTIONS you'd pass into a find(:all, OPTIONS)
- def self.delete_all(options)
+ def self.delete_all(options={})
# could make this quicker by just getting item_names and deleting attributes rather than creating objects
obs = self.find(:all, options)
i = 0
@@ -822,7 +822,7 @@ def self.delete_all(options)
end
# Pass in the same OPTIONS you'd pass into a find(:all, OPTIONS)
- def self.destroy_all(options)
+ def self.destroy_all(options={})
obs = self.find(:all, options)
i = 0
obs.each do |a|
View
2 lib/simple_record/sharding.rb
@@ -47,7 +47,7 @@ def find_sharded(*params)
end
end
- # todo: should we have a global executor?
+ # todo: should have a global executor
executor = options[:concurrent] ? Concur::Executor.new_multi_threaded_executor : Concur::Executor.new_single_threaded_executor
results = ShardedResults.new(params)
futures = []

0 comments on commit 34500c1

Please sign in to comment.