Skip to content

Instantly share code, notes, and snippets.

@kristjan
Last active August 29, 2015 14:21
Show Gist options
  • Save kristjan/d8a6680b07a661833045 to your computer and use it in GitHub Desktop.
Save kristjan/d8a6680b07a661833045 to your computer and use it in GitHub Desktop.
ActiveRecord log silencing example
$ rails c
Loading development environment (Rails 4.1.2)
[1] pry(main)> Specialist.find(15)
Specialist Load (0.9ms) SELECT "specialists".* FROM "specialists" WHERE "specialists"."id" = $1 LIMIT 1 [["id", 15]]
=> #<Specialist id: 15, ...>
[2] pry(main)> ActiveRecord::Base.logger.silence(Logger::FATAL) { Specialist.find(16) }
=> #<Specialist id: 16, ...>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment