named_scope_patch.rb

Path: lib/will_paginate/named_scope_patch.rb
Last Update: Sun Oct 26 15:36:07 +0000 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 26
26:   def method_missing(method, *args, &block)
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, &block)
34:       end
35:     end
36:   end

[Source]

    # File lib/will_paginate/named_scope_patch.rb, line 13
13:     def method_missing_without_paginate(method, *args, &block)
14:       if @reflection.klass.scopes.include?(method)
15:         @reflection.klass.scopes[method].call(self, *args, &block)
16:       else
17:         method_missing_without_scopes(method, *args, &block)
18:       end
19:     end

[Source]

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

[Validate]