This repository has been archived on 2024-08-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
redstoner.com/app/models/threadreply.rb

26 lines
504 B
Ruby

class Threadreply < ActiveRecord::Base
belongs_to :forumthread
belongs_to :user_author, class_name: "User", foreign_key: "user_author_id"
belongs_to :user_editor, class_name: "User", foreign_key: "user_editor_id"
validates_presence_of :content
validates_length_of :content, in: 2..10000
def thread
forumthread
end
def author
@author ||= if self.user_author.present?
user_author
else
User.first
end
end
def editor
@editor ||= user_editor
end
end