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

Change rails? method to check railtie instead rails module #221

Conversation

antoniofilho
Copy link

When some non rails project depends on actionmailer, the rails-sanitizer-html gem is loaded and the Rails module is created, this way to check Rails module is not a good idea...

Take a look this issue rails/rails-html-sanitizer#25

A way to solve this is to check for specific methods instead Rails module or Railtie...

…y we avoid problems with actionmailer gem in non rails project
@kjvarga
Copy link
Owner

kjvarga commented Aug 10, 2016

@antoniofilho why not use Rails::VERSION? That seems safer and more backwards compatible. Rails::Railtie was only added in Rails v3 http://apidock.com/rails/Rails/Railtie

@kjvarga
Copy link
Owner

kjvarga commented Aug 10, 2016

Also lib/sitempa_generator/tasks.rb checks for Rails in two spots.

kjvarga added a commit that referenced this pull request Feb 13, 2017
…using action_mailer without Rails the rails-sanitizer-html gem defines a Rails module
@kjvarga
Copy link
Owner

kjvarga commented Feb 21, 2017

Released in v5.3.0

@kjvarga kjvarga closed this Feb 21, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants