How do I find where a constant is defined in Ruby?
There is a better way to do this as of Ruby 2.7, which is Module.const_source_location. > Admin.const_source_location(:LIMIT) #=> [“SOME_PATH/user.rb”, 2] References: Ruby 2.7 adds Module#const_source_location ruby-core.doc Bonus from @ulysse-bn: To have a quick access to this method, you can add it to IRB config like this: ~/.irbrc # displays path of constant # # Usage: … Read more