* Add dependent: :destroy relation to user.notes * Add cleanup script for orphaned notes * Reorder relations and reorganize specs in User * Update specs as notes are not needed after a user is deleted * Tweets can just be nullified * Add other cleanup scripts * Tell the specs we keep tweets * Fix comments * Keep page_views and rating_votes when a user is deleted * Fix specs
6 lines
194 B
Ruby
6 lines
194 B
Ruby
class Note < ApplicationRecord
|
|
belongs_to :author, class_name: "User", optional: true
|
|
belongs_to :noteable, polymorphic: true, touch: true
|
|
|
|
validates :content, :reason, presence: true
|
|
end
|