This commit is contained in:
Toks
2014-02-28 19:02:30 -05:00
parent fee7228aaf
commit 5d5caf5eea
4 changed files with 5 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ class Note < ActiveRecord::Base
validates_presence_of :post_id, :creator_id, :updater_id, :x, :y, :width, :height
validate :post_must_exist
validate :note_within_image, :message => "must be inside the image"
has_many :versions, :class_name => "NoteVersion", :order => "note_versions.id ASC"
has_many :versions, :class_name => "NoteVersion", :dependent => :destroy, :order => "note_versions.id ASC"
after_save :update_post
after_save :create_version
validate :post_must_not_be_note_locked