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

Errors with Rails 4.2.5 #53

Closed
billhorsman opened this issue Nov 24, 2015 · 7 comments
Closed

Errors with Rails 4.2.5 #53

billhorsman opened this issue Nov 24, 2015 · 7 comments

Comments

@billhorsman
Copy link

Hi Jack!

I'm getting 32 failures when running the tests for this project with Rails 4.2.5. They pass with Rails 4.2.4 and fail with Rails 4.2.5.rc1 and later. For instance:

PermanentRecords#revive with dependent records as default scope with :has_one cardinality revives them
     Failure/Error: let!(:record) { hole.destroy }
     NoMethodError:
       undefined method `attributes' for false:FalseClass
     # ./lib/permanent_records.rb:92:in `destroy_with_permanent_records'
     # ./lib/permanent_records.rb:47:in `block in destroy'
     # ./lib/permanent_records.rb:43:in `destroy'
     # ./spec/permanent_records_spec.rb:227:in `block (3 levels) in <top (required)>'

In my own code, this causes a problem when I use the after_destroy callback. The before_destroy callback works fine.

It doesn't seem to have been caused by a recent changed to this project but nothing leaps out at me in in the changes between Rails 4.2.4 and 4.2.5.rc1.

@gsmetal
Copy link
Contributor

gsmetal commented Nov 26, 2015

+1. Version 3.3.0 does not work for now. Version 4.0.0 is not installing due to dependencies of activerecord (4.2.0).

@orenyk
Copy link

orenyk commented Dec 9, 2015

+1 to @gsmetal's comment about the dependency conflict.

@Preacher
Copy link

Preacher commented Dec 9, 2015

I edited Version 4.0.0 locally to install with Rails 4.2.5 and I'm experiencing the same error there.

As of now, I had to downgrade to Rails 4.2.4.

@JackDanger
Copy link
Owner

The internal API to callbacks changed slightly. Apologies for the broken code! This is now fixed on master and I've pushed a gem version 4.1.0 with a fix. Thanks!

@Preacher
Copy link

Works great. Thanks a bunch!!

@amymariaparker
Copy link

Thanks

@billhorsman
Copy link
Author

Thanks Jack. That works fine.

Seraff added a commit to Seraff/permanent_records that referenced this issue Apr 8, 2016
Reviving crashes after a custom after_revive callback defined.
JackDanger added a commit that referenced this issue Apr 8, 2016
Error in revive callback, resolves #53
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

6 participants