ruby on rails - how in Pry (or other tool) would I see the source code for ActiveRecord::Base -


i saw friend , pretty slick. opened rails console session using pry , think cd'd rails , able show-source base.

within app, can do:

>rails c (pry)>show-source user # shows user  >show-source pry # shows /gems/ruby-2.1.5/gems/pry-0.10.0/lib/pry/pry_instance.rb 

but how show activerecord::base?

[2] pry(main)> cd rails [3] pry(rails):1> show-source activerecord::base error: couldn't locate definition activerecord::base! [5] pry(rails):1> cd activerecord [6] pry(activerecord):2> show-source base error: couldn't locate definition base! [7] pry(activerecord):2>  

ultimately, i'd able show https://github.com/rails/rails/blob/master/activerecord/lib/active_record/base.rb using either editor or less in currect console session. best way either via pry or other tool?


Comments