Skip to content

Instantly share code, notes, and snippets.

@HusseinMorsy
Created November 12, 2009 16:28
Show Gist options
  • Save HusseinMorsy/233033 to your computer and use it in GitHub Desktop.
Save HusseinMorsy/233033 to your computer and use it in GitHub Desktop.
class ActiveRecord::Base
def self.acts_as_yaffle(options={})
# ...
end
def squawk
# ....
end
end
class Duck < ActiveRecord::Base
acts_as_yaffle :last_squawk
end
d = Duck.new
d.squawk "Endlich Feierabend"
d.save
puts Duck.last.last_squawk
# Endlich Feierabend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment