From fe446a52fa3ce3e93e3bc66fefba76301b748167 Mon Sep 17 00:00:00 2001 From: Sebastian Schuster Date: Mon, 12 Aug 2013 10:28:24 +0200 Subject: [PATCH] Fixed comment and non-functional error check --- ...807141542_remove_files_attached_to_projects_and_versions.rb | 2 +- .../acts_as_activity_provider/lib/acts_as_activity_provider.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/db/migrate/20130807141542_remove_files_attached_to_projects_and_versions.rb b/db/migrate/20130807141542_remove_files_attached_to_projects_and_versions.rb index ac255eda45..901934c547 100644 --- a/db/migrate/20130807141542_remove_files_attached_to_projects_and_versions.rb +++ b/db/migrate/20130807141542_remove_files_attached_to_projects_and_versions.rb @@ -3,7 +3,7 @@ class RemoveFilesAttachedToProjectsAndVersions < ActiveRecord::Migration if Attachment.where(:container_type => ['Version','Project']).any? raise "There are still attachments attached to Versions or Projects, please remove them." end - #undocument this code if you want do delete all existing files attached to projects and versions + #uncomment this code if you want do delete all existing files attached to projects and versions #Attachment.where(:container_type => ['Version','Project']).destroy_all end diff --git a/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb b/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb index 5efa4f99e8..93fc90cbd8 100644 --- a/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb +++ b/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb @@ -46,8 +46,9 @@ module Redmine module ClassMethods # Returns events of type event_type visible by user that occured between from and to def find_events(event_type, user, from, to, options) + raise "#{self.name} can not provide #{event_type} events." if activity_provider_options[event_type].nil? + provider_options = activity_provider_options[event_type].dup - raise "#{self.name} can not provide #{event_type} events." if provider_options.nil? scope_options = {} cond = ARCondition.new