Giter Site home page Giter Site logo

Comments (4)

mislav avatar mislav commented on September 17, 2024

method_missing only handles calls to nonexistent methods that start with "paginate". it will never handle calls to methods that actually exist.

I'm not sure what you want here, and what needs to be fixed. In the test you wrote you just defined a sample method and checked if it's defined. This confuses me and I still don't see how this relates to pagination or ActiveRecord at all.

from will_paginate.

enriquez avatar enriquez commented on September 17, 2024

The problem is that will_paginate breaks respond_to? for the sample method.

Example:

class Topic < ActiveRecord::Base
  def self.paginate_by_definition_in_class; end
end

Topic.respond_to?(:paginate_by_definition_in_class) # => false (should be true)

Since the sample method starts with the word "paginate", will_paginate's respond_to? method never checks for any existing methods that start with the word "paginate". Therefore, it unexpectedly returns false because the plugin thinks that "definition_in_class" is a dynamic finder.

from will_paginate.

mislav avatar mislav commented on September 17, 2024

Oh. I'm very sorry. I didn't read good enough. I thought you said method calls are broken, while it's just respond_to? in question.

Gonna pull your fix next time I'm working on wp. Thanks

from will_paginate.

mislav avatar mislav commented on September 17, 2024

Pulled! Thanks

from will_paginate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.