simple refactoring

This commit is contained in:
Andrey Kumanyaev 2012-10-09 04:10:04 +04:00
parent a635b9da97
commit df7c52489a
21 changed files with 276 additions and 264 deletions

View file

@ -8,12 +8,9 @@ module IssueCommonality
belongs_to :assignee, class_name: "User"
has_many :notes, as: :noteable, dependent: :destroy
validates_presence_of :project_id
validates_presence_of :author_id
validates :title,
presence: true,
length: { within: 0..255 }
validates :project, presence: true
validates :author, presence: true
validates :title, presence: true, length: { within: 0..255 }
validates :closed, inclusion: { in: [true, false] }
scope :opened, where(closed: false)