Skip to content

Instantly share code, notes, and snippets.

@damon
Created May 29, 2009 16:39
Show Gist options
  • Save damon/120053 to your computer and use it in GitHub Desktop.
Save damon/120053 to your computer and use it in GitHub Desktop.
# handy trick for keeping your AR models more manageable
# see http://m.onkey.org/2008/9/15/active-record-tips-and-tricks for info
class << ActiveRecord::Base
def concerned_with(*concerns)
concerns.each do |concern|
require_dependency "#{name.underscore}/#{concern}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment