mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-14 19:28:10 +01:00
make attachments accesible from user model and fix cleaning up attachment on destroy
This commit is contained in:
parent
8d9f07f57b
commit
a28edbd5d6
5 changed files with 40 additions and 7 deletions
|
|
@ -25,7 +25,7 @@ class Todo < ActiveRecord::Base
|
|||
has_many :pending_successors, -> {where('todos.state = ?', 'pending')}, :through => :predecessor_dependencies,
|
||||
:source => :successor
|
||||
|
||||
has_many :attachments, dependent: :delete_all
|
||||
has_many :attachments, dependent: :destroy
|
||||
|
||||
# scopes for states of this todo
|
||||
scope :active, -> { where state: 'active' }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue