Skip to content

Instantly share code, notes, and snippets.

@billsaysthis
Created September 11, 2009 18:50
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 billsaysthis/185502 to your computer and use it in GitHub Desktop.
Save billsaysthis/185502 to your computer and use it in GitHub Desktop.
class Note < ActiveRecord::Base
belongs_to :creator, :class_name => "User", :foreign_key => :creator_id
# Fix DB default problem for TEXT and BINARY
def initialize(attributes=nil)
super({:body => ''}.merge(attributes || {}))
end
def to_s
self.body
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment