respond_to? doesn't return true for dynamic methods added by method_missing #26

Merged
merged 2 commits into from Dec 5, 2013

Conversation

Projects
None yet
3 participants
Contributor

petergoldstein commented Aug 22, 2012

In both acts_as_follower and acts_as followable method_missing is overridden to add dynamic methods to the class. But respond_to? returns false when called with the symbols for these dynamic methods.

This pull request update respond_to? to behave correctly.

Please note that this pull request also contains a gemspec update required to get the tests to run green. This gemspec change was designed to just get the tests running, and it should be replaced by the gemspec changes in this pull request if they are both pulled in.

Thanks.

Contributor

petergoldstein commented Dec 5, 2013

@tcocca Any chance you can merge this? Just rebased.

tcocca added a commit that referenced this pull request Dec 5, 2013

Merge pull request #26 from petergoldstein/feature/add_respond_to
respond_to? doesn't return true for dynamic methods added by method_missing

@tcocca tcocca merged commit d3433c6 into tcocca:master Dec 5, 2013

1 check passed

default The Travis CI build passed
Details
Owner

tcocca commented Dec 5, 2013

@petergoldstein Thanks for the help and rebasing. I just released a 0.2.1 version: http://rubygems.org/gems/acts_as_follower

Contributor

petergoldstein commented Dec 5, 2013

@tcocca Great, thanks.

@petergoldstein petergoldstein deleted the petergoldstein:feature/add_respond_to branch Dec 5, 2013

Thank you for this. I just bumped heads with this last night using a Draper decorated object. acts_as_follower v0.2.1 resolves this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment