named_scope_patch.rb

Path: lib/will_paginate/named_scope_patch.rb
Last Update: Tue May 20 11:37:23 -0500 2008
dot/f_1.png

Methods

External Aliases

method_missing_without_paginate -> method_missing_without_scopes

Public Instance methods

[Source]

    # 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

[Source]

    # 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

[Source]

   # File lib/will_paginate/named_scope_patch.rb, line 5
5:   def with_scope(*args, &block)
6:     @reflection.klass.send :with_scope, *args, &block
7:   end

[Validate]