-# id :integer not null, primary key
-# note_id :integer not null
+# id :bigint(8) not null, primary key
+# note_id :bigint(8) not null
belongs_to :note, :foreign_key => :note_id, :touch => true
belongs_to :author, :class_name => "User", :foreign_key => :author_id
validates :id, :uniqueness => true, :presence => { :on => :update },
belongs_to :note, :foreign_key => :note_id, :touch => true
belongs_to :author, :class_name => "User", :foreign_key => :author_id
validates :id, :uniqueness => true, :presence => { :on => :update },
validates :note, :presence => true, :associated => true
validates :visible, :inclusion => [true, false]
validates :author, :associated => true
validates :event, :inclusion => %w[opened closed reopened commented hidden]
validates :note, :presence => true, :associated => true
validates :visible, :inclusion => [true, false]
validates :author, :associated => true
validates :event, :inclusion => %w[opened closed reopened commented hidden]
- validates :body, :length => { :maximum => 2000 },
- :format => /\A[^\x00-\x08\x0b-\x0c\x0e-\x1f\x7f\ufffe\uffff]*\z/
+ validates :body, :length => { :maximum => 2000 }, :characters => true