Skip to content

Instantly share code, notes, and snippets.

@kballenegger
Created July 31, 2015 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kballenegger/663fd85373df5e13fa61 to your computer and use it in GitHub Desktop.
Save kballenegger/663fd85373df5e13fa61 to your computer and use it in GitHub Desktop.
[WIP] Hide cluttery auto-generated Rails methods from Pry.
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