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

Need to add ActiveSupport as dependency #1042

Closed
theRealNG opened this issue Jan 31, 2018 · 7 comments
Closed

Need to add ActiveSupport as dependency #1042

theRealNG opened this issue Jan 31, 2018 · 7 comments

Comments

@theRealNG
Copy link
Contributor

theRealNG commented Jan 31, 2018

#ruby version 2.4.3
active_record version ( 5.1.4 )
paper_trail version (8.1.2)

I'm working on an application not based on rails but I am using active record. I noticed that when I open irb and require 'paper_trail', I am getting the following error

NoMethodError: undefined method `squish' for #<String:0x00007f8710b395e0>

We are using squish method that is defined in active_support:
https://github.com/rails/rails/blob/cfb1e4dfd8813d3d5c75a15a750b3c53eebdea65/activesupport/lib/active_support/core_ext/string/filters.rb#L21

Therefore we should add active_support to dependency so that we don't run into this error.

Steps to reproduce the error:
Clone this repo:
https://github.com/theRealNG/paper_trail_active_support_dependency

  1. Open irb terminal
  2. Type require "paper_trail" and you will get that squish is not defined.
@jaredbeck
Copy link
Member

jaredbeck commented Jan 31, 2018

Hi Ng. Sorry, I don't understand your setup. The paper_trail gem depends on activerecord which in turn depends on activesupport. Therefore, AS already is a (transitive) dependency of PT. What am I missing?

I'm checking out your repo now ..

@jaredbeck
Copy link
Member

I'm checking out your repo now ..

We need to add some requires, don't we?

@theRealNG
Copy link
Contributor Author

theRealNG commented Jan 31, 2018

I'm running into undefined method when I'm trying to require the paper_trail gem itself.

@theRealNG
Copy link
Contributor Author

I think to use the squish method which is defined in the active_support you need to explicitly add it as dependency. ( Not 100% sure about it )

@jaredbeck
Copy link
Member

Ng, Please try

gem 'paper_trail', 
  git: 'git@github.com:airblade/paper_trail.git', 
  branch: 'require_ar_and_as'

and let me know if that works for you. Thanks.

@theRealNG
Copy link
Contributor Author

@jaredbeck Yes that solves the issue.

@jaredbeck
Copy link
Member

Fixed by #1043 expected release 9.0.0

Thanks Ng.

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