Create attachment model and hook it up to todo

An attachment has write permissions on group so that managing
attachments work from different users in same group, i.e. user apache
and user mail.
This commit is contained in:
Reinier Balt 2015-08-05 13:01:02 +02:00
parent 5499ac2a03
commit 2bd68fecb7
10 changed files with 121 additions and 39 deletions

View file

@ -24,6 +24,7 @@ class Todo < ActiveRecord::Base
:source => :predecessor
has_many :pending_successors, -> {where('todos.state = ?', 'pending')}, :through => :predecessor_dependencies,
:source => :successor
has_many :attachments, dependent: :destroy
# scopes for states of this todo
scope :active, -> { where state: 'active' }