Skip to content

Instantly share code, notes, and snippets.

@stevenhaddox
Created April 22, 2010 14:47
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 stevenhaddox/375317 to your computer and use it in GitHub Desktop.
Save stevenhaddox/375317 to your computer and use it in GitHub Desktop.
module Notable
def self.included(base)
base.has_many :notes, :as => :notable
base.accepts_nested_attributes_for :notes
end
end
class User < ActiveRecord::Base
include Notable
end
class Book < ActiveRecord::Base
include Notable
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment