Skip to content
Browse files

context should forward to Query translator

  • Loading branch information...
1 parent de8afad commit f2c83f8606ce520c5d0549cdab6e9eb9079400fc @defunkt committed Feb 25, 2008
Showing with 4 additions and 15 deletions.
  1. +4 −15 lib/ambition/context.rb
View
19 lib/ambition/context.rb
@@ -1,5 +1,6 @@
module Ambition
class Context
+ undef_method :to_s
include API
##
@@ -38,23 +39,11 @@ def adapter_query
Processors::Base.translator(self, :Query)
end
- def to_hash
- adapter_query.to_hash
+ def method_missing(method, *args, &block)
+ return super unless adapter_query.respond_to? method
+ adapter_query.send(method, *args, &block)
end
- def to_s
- adapter_query.to_s
- end
-
- def kick
- adapter_query.kick
- end
-
- def size
- adapter_query.size
- end
- alias_method :length, :size
-
def inspect
"(Query object: call #to_s or #to_hash to inspect, call an Enumerable (such as #each or #first) to request data)"
end

0 comments on commit f2c83f8

Please sign in to comment.
Something went wrong with that request. Please try again.