Skip to content

Instantly share code, notes, and snippets.

@apeiros
Created February 11, 2010 20:56
Show Gist options
  • Save apeiros/301943 to your computer and use it in GitHub Desktop.
Save apeiros/301943 to your computer and use it in GitHub Desktop.
module Yaffle
module ForActiveRecordBase # better names welcome
def acts_as_something
...do some stuff, e.g. define scopes and associations...
extend MyActsAs::ClassMethods
include MyActsAs::InstanceMethods
end
end
module ClassMethods
end
module InstanceMethods
end
end
ActiveRecord::Base.send :include, Yaffle::ForActiveRecordBase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment