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

paranoia >= 2.5.1 assumes Rails constant is defined #528

Closed
lionelchauvin opened this issue Feb 11, 2022 · 2 comments
Closed

paranoia >= 2.5.1 assumes Rails constant is defined #528

lionelchauvin opened this issue Feb 11, 2022 · 2 comments

Comments

@lionelchauvin
Copy link

lionelchauvin commented Feb 11, 2022

3572129#diff-a7b13874ca65cce80cfa49aa594d2cbb4a486019b334c831ce0bd5de605f2533R1

This commit checks if Rails.env.test? in order to add rspec matchers but rails is not a dependency of paranoia.
Gems that are only dependent on activerecord (and paranoia) crash on this line.

@lionelchauvin
Copy link
Author

It could be replaced by:
if !(defined? Rails) || Rails.env.test?

or
if ENV['RAILS_ENV'] == 'test'

or don't require 'paranoia/rspec' and let developpers do it.

@lionelchauvin lionelchauvin changed the title paranoia 2.5.2 assumes Rails constant is defined paranoia >= 2.5.1 assumes Rails constant is defined Feb 11, 2022
@mathieujobin
Copy link
Collaborator

this is merged in core but still not tagged release
#529

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

2 participants