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

before_restore raises an exception when trying to append to nil? #488

Closed
lubekpl opened this issue Mar 24, 2020 · 0 comments
Closed

before_restore raises an exception when trying to append to nil? #488

lubekpl opened this issue Mar 24, 2020 · 0 comments

Comments

@lubekpl
Copy link

lubekpl commented Mar 24, 2020

👋

Trying to update rails from 5.0.7.2 to 5.1.7 and running into an issue, namely, calling paranoia ends up raising an exception

concern

require "paranoia"

module SoftDeletable
  extend ActiveSupport::Concern

  included do
    acts_as_paranoid without_default_scope: true
  end
end

model

class User < ApplicationRecord
  include SoftDeletable
end 
be rspec spec/models/user_spec.rb
Skipping generating coverage report, CI env var not defined

An error occurred while loading ./spec/models/user_spec.rb.
Failure/Error: include SoftDeletable

NoMethodError:
  undefined method `append' for nil:NilClass

exception while pryed inside paranoia itself

[test] User:0> before_restore {
[test] User:0>   self.class.notify_observers(:before_restore, self) if self.class.respond_to?(:notify_observers)
[test] User:0> }
NoMethodError: undefined method `append' for nil:NilClass

Calling before_restore with an empty block results in the same error

I can't seem to get what the problem here is, can you guys offer any insight?

@lubekpl lubekpl closed this as completed Mar 25, 2020
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

1 participant