Created
January 9, 2009 21:08
-
-
Save xwmx/45282 to your computer and use it in GitHub Desktop.
ActiveRecord Monkeypatching
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 | |
def paged_find_tagged_with(tags, args = {}) | |
tags.nil? ? paginate(args) : paginate_tagged_with(tags, args) | |
end | |
def concerned_with(*concerns) | |
concerns.each do |concern| | |
require_dependency "#{name.underscore}/#{concern}" | |
end | |
end | |
end | |
class ActiveRecord::Base | |
def to_type | |
self.class.name.downcase | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment