Created
July 31, 2015 18:31
-
-
Save kballenegger/663fd85373df5e13fa61 to your computer and use it in GitHub Desktop.
[WIP] Hide cluttery auto-generated Rails methods from Pry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ActiveRecord::Base | |
alias :old_methods :methods | |
def methods | |
old_methods.reject do |m| | |
m = m.to_s | |
m =~ /(=|_changed\?|_before_type_cast|_was|_change|_will_change!)$/ || \ | |
m =~ /^_/ | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment