Add comments to ActiveRecord queries to see where they came from or what user caused them
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
gemfiles
lib/active_record
spec
.travis.yml
Appraisals
Gemfile
Gemfile.lock
MIT-LICENSE
Rakefile
Readme.md
active_record-comments.gemspec
gem-public_cert.pem

Readme.md

Adds comments to your activerecord queries so you can seem where they came from or what user caused them.
for on Rails 2 + 3 + 4

Install

gem install active_record-comments

Usage

require "active_record/comments"

# => SELECT ... /* user.rb:123 */
result = ActiveRecord::Comments.comment("user.rb:123"){ User.where("x like y").count }

# => SELECT ... /* account cleanup initial */
result = ActiveRecord::Comments.comment("account cleanup") do
  ActiveRecord::Comments.comment("initial"){ User.where("x like y").count }
end

Author

Michael Grosser
michael@grosser.it
License: MIT
Build Status