diff --git a/app/models/attachment.rb b/app/models/attachment.rb index d42be866..fcecea95 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -1,13 +1,9 @@ class Attachment < ActiveRecord::Base belongs_to :todo, touch: true - # enable write permissions on group, since MessageGateway could be run under different - # user than Tracks (i.e. apache versus mail) - has_attached_file :file, url: '/:class/:id/:basename.:extension', - path: ":rails_root/db/assets/#{Rails.env}/:class/:id/:basename.:extension", - override_file_permissions: 0660 + path: ":rails_root/db/assets/#{Rails.env}/:class/:id/:basename.:extension" do_not_validate_attachment_file_type :file # validates_attachment_content_type :file, :content_type => ["text/plain"] diff --git a/app/models/todo.rb b/app/models/todo.rb index a39e5964..8e4ee7c6 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -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: :destroy + has_many :attachments, dependent: :delete_all # scopes for states of this todo scope :active, -> { where state: 'active' }