update factories + tests
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
class Comment < ApplicationRecord
|
||||
include Mentionable
|
||||
|
||||
validate :validate_post_exists, :on => :create
|
||||
validate :validate_creator_is_not_limited, :on => :create
|
||||
validates_presence_of :body, :message => "has no content"
|
||||
belongs_to :post
|
||||
|
||||
@@ -5,7 +5,7 @@ class Note < ApplicationRecord
|
||||
belongs_to :post
|
||||
belongs_to_creator
|
||||
has_many :versions, -> {order("note_versions.id ASC")}, :class_name => "NoteVersion", :dependent => :destroy
|
||||
validates_presence_of :post_id, :creator_id, :x, :y, :width, :height, :body
|
||||
validates_presence_of :creator_id, :x, :y, :width, :height, :body
|
||||
validate :post_must_exist
|
||||
validate :note_within_image
|
||||
after_save :update_post
|
||||
|
||||
Reference in New Issue
Block a user