class ControlledVersioning::Version < ActiveRecord::Base belongs_to :versionable, polymorphic: true belongs_to :user has_many :version_attributes, as: :version has_many :version_children, as: :version validates :versionable, presence: true def accept RevisionAccepter.new(self) update_attributes(pending: false, approved: true) end def decline update_attributes(pending: false, declined: true) end end