Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Version.method_defined? :object_changes #74

Closed
vkhater opened this issue Jul 22, 2011 · 7 comments
Closed

Issue with Version.method_defined? :object_changes #74

vkhater opened this issue Jul 22, 2011 · 7 comments

Comments

@vkhater
Copy link

vkhater commented Jul 22, 2011

Hi,

In development mode Version.method_defined? :object_changes always seems to be returning false. Can we use Version.column_names.include?("object_changes") instead? Something I am missing here?

>> Version.method_defined? :object_changes
>>  => false

BTW. Great plugin. Appreciate the work you have put in to it.

@airblade
Copy link
Collaborator

Funnily enough looking into method_defined? is already on my to-do list. It was introduced in a recent pull request and, since it passed the tests, I accepted it while deferring my checking until later. It seems I was too lazy! Sorry about that.

I'm running out the door now but I'll fix this up later on when I get back. I'll either go with your suggestion or responds_to?.

@edtsech
Copy link
Contributor

edtsech commented Jul 22, 2011

Yes, it's strange. I have also this issue in my development environment but 'with-changes' feature works fine.

Version.method_defined? :object_changes
=> false
Version.find(46).changeset
=> {"post_id"=>[1, 10]} 

@vkhater, 'with-changes' feature work for you?

I agree that Version.column_names.include?("object_changes") or respond_to? maybe will be better.

@vkhater
Copy link
Author

vkhater commented Jul 22, 2011

@edtsech, my guess to Version.find(46).changeset works fine is since the Version class is already instantiated. Even this works..

Version.new
Version.method_defined? :obect_changes
=> true

@edtsech
Copy link
Contributor

edtsech commented Jul 22, 2011

Added pull request #75, hope it closes this issue.

airblade added a commit that referenced this issue Jul 23, 2011
…trail into edtsech-74_method_defined

* '74_method_defined' of https://github.com/edtsech/paper_trail:
  #74: Changed method_defined? to column_names.include? & Fix test for case without object_changes column
@airblade
Copy link
Collaborator

Thanks to @edstech's pull request, this should be fixed in v2.2.9.

@vkhater
Copy link
Author

vkhater commented Jul 25, 2011

Thanks @airblade and @edtsech for the fix :)

@edtsech
Copy link
Contributor

edtsech commented Jul 25, 2011

Thank you for report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants