| Path: | lib/will_paginate/named_scope_patch.rb |
| Last Update: | Tue May 20 11:37:23 -0500 2008 |
based on dev.rubyonrails.org/changeset/9084
| method_missing_without_paginate | -> | method_missing_without_scopes |
# File lib/will_paginate/named_scope_patch.rb, line 28
28: def method_missing(method, *args, &block)
29: if @target.respond_to?(method) || (!@reflection.klass.respond_to?(method) && Class.respond_to?(method))
30: super
31: elsif @reflection.klass.scopes.include?(method)
32: @reflection.klass.scopes[method].call(self, *args)
33: else
34: @reflection.klass.with_scope(:find => { :conditions => @finder_sql, :joins => @join_sql, :readonly => false }) do
35: @reflection.klass.send(method, *args, &block)
36: end
37: end
38: end
# File lib/will_paginate/named_scope_patch.rb, line 15
15: def method_missing_without_paginate(method, *args, &block)
16: if @reflection.klass.scopes.include?(method)
17: @reflection.klass.scopes[method].call(self, *args, &block)
18: else
19: method_missing_without_scopes(method, *args, &block)
20: end
21: end