Path: | lib/will_paginate/named_scope_patch.rb |
Last Update: | Tue Feb 10 22:17:26 +0000 2009 |
method_missing_without_paginate | -> | method_missing_without_scopes |
# File lib/will_paginate/named_scope_patch.rb, line 26 26: def method_missing(method, *args) 27: if @target.respond_to?(method) || (!@reflection.klass.respond_to?(method) && Class.respond_to?(method)) 28: super 29: elsif @reflection.klass.scopes.include?(method) 30: @reflection.klass.scopes[method].call(self, *args) 31: else 32: @reflection.klass.with_scope(:find => { :conditions => @finder_sql, :joins => @join_sql, :readonly => false }) do 33: @reflection.klass.send(method, *args) { |*a| yield(*a) if block_given? } 34: end 35: end 36: end
# File lib/will_paginate/named_scope_patch.rb, line 13 13: def method_missing_without_paginate(method, *args) 14: if @reflection.klass.scopes.include?(method) 15: @reflection.klass.scopes[method].call(self, *args) { |*a| yield(*a) if block_given? } 16: else 17: method_missing_without_scopes(method, *args) { |*a| yield(*a) if block_given? } 18: end 19: end