Last Updated: February 25, 2016
·
359
· yottanami

Location of a class in Ruby

ActiveRecord::Base.method(:validates).source_location

# => ["/Users/laas/.rvm/gems/ruby-1.9.2-p0@arveaurik/gems/activemodel-3.2.2/lib/active_model/validations/validates.rb", 81]