Skip to content

Commit

Permalink
Handle situations when Rails module is defined without env
Browse files Browse the repository at this point in the history
Gems like rails-html-sanitizer open Rails namespace without
requiring Rails. Instead check if Rails.env is defined.

Similar to: rails/activeresource#216
  • Loading branch information
wkrsz committed Jan 26, 2017
1 parent c10010c commit 61170b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/wicked_pdf.rb
Expand Up @@ -96,7 +96,7 @@ def pdf_from_url(url, options = {})
private

def in_development_mode?
return Rails.env == 'development' if defined?(Rails)
return Rails.env == 'development' if defined?(Rails.env)
RAILS_ENV == 'development' if defined?(RAILS_ENV)
end

Expand Down

0 comments on commit 61170b8

Please sign in to comment.