lib/dynamoid/criteria.rb in dynamoid-0.0.4 vs lib/dynamoid/criteria.rb in dynamoid-0.0.5

- old
+ new

@@ -7,12 +7,16 @@ module Criteria extend ActiveSupport::Concern module ClassMethods [:where, :all, :first, :each].each do |meth| - define_method(meth) do |opts| + define_method(meth) do |*args| chain = Dynamoid::Criteria::Chain.new(self) - chain.send(meth, opts) + if args + chain.send(meth, *args) + else + chain.send(meth) + end end end end end \ No newline at end of file