Skip to content

Commit

Permalink
Use ::Kernel.warn instead of implicit receiver warn
Browse files Browse the repository at this point in the history
Some people override warn in their applications. Using an explicit
receiver protects against this.

[Fixes #791]
  • Loading branch information
jaredbeck committed May 4, 2016
1 parent ad0a7d7 commit 6f860c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/generators/paper_trail/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def self.next_migration_number(dirname)
def add_paper_trail_migration(template)
migration_dir = File.expand_path("db/migrate")
if self.class.migration_exists?(migration_dir, template)
warn "Migration already exists: #{template}"
::Kernel.warn "Migration already exists: #{template}"
else
migration_template "#{template}.rb", "db/migrate/#{template}.rb"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/paper_trail/frameworks/rails/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def warn_about_not_setting_whodunnit
user_present = user_for_paper_trail.present?
whodunnit_blank = ::PaperTrail.whodunnit.blank?
if enabled && user_present && whodunnit_blank && !@set_paper_trail_whodunnit_called
warn <<-EOS.strip_heredoc
::Kernel.warn <<-EOS.strip_heredoc
user_for_paper_trail is present, but whodunnit has not been set.
PaperTrail no longer adds the set_paper_trail_whodunnit
before_filter for you. Please add this before_filter to your
Expand Down

0 comments on commit 6f860c4

Please sign in to comment.