diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-05-18 20:09:59 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-05-18 20:09:59 +0000 |
commit | 2e67ffe769a3f2dda6e95c5b03cf054ec5de4d16 (patch) | |
tree | 6cebb1ea6f2840f359a210ccd90b20d658fd6501 /lib/plugins | |
parent | ed364c9114e95ceff8544ade846341f3879af2ed (diff) | |
download | redmine-2e67ffe769a3f2dda6e95c5b03cf054ec5de4d16.tar.gz redmine-2e67ffe769a3f2dda6e95c5b03cf054ec5de4d16.zip |
Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11874 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/plugins')
-rw-r--r-- | lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb | 10 |
1 files changed, 5 insertions, 5 deletions
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 f92aae250..d72f42417 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 @@ -57,26 +57,26 @@ module Redmine scope = self if from && to - scope = scope.scoped(:conditions => ["#{provider_options[:timestamp]} BETWEEN ? AND ?", from, to]) + scope = scope.where("#{provider_options[:timestamp]} BETWEEN ? AND ?", from, to) end if options[:author] return [] if provider_options[:author_key].nil? - scope = scope.scoped(:conditions => ["#{provider_options[:author_key]} = ?", options[:author].id]) + scope = scope.where("#{provider_options[:author_key]} = ?", options[:author].id) end if options[:limit] # id and creation time should be in same order in most cases - scope = scope.scoped(:order => "#{table_name}.id DESC", :limit => options[:limit]) + scope = scope.reorder("#{table_name}.id DESC").limit(options[:limit]) end if provider_options.has_key?(:permission) - scope = scope.scoped(:conditions => Project.allowed_to_condition(user, provider_options[:permission] || :view_project, options)) + scope = scope.where(Project.allowed_to_condition(user, provider_options[:permission] || :view_project, options)) elsif respond_to?(:visible) scope = scope.visible(user, options) else ActiveSupport::Deprecation.warn "acts_as_activity_provider with implicit :permission option is deprecated. Add a visible scope to the #{self.name} model or use explicit :permission option." - scope = scope.scoped(:conditions => Project.allowed_to_condition(user, "view_#{self.name.underscore.pluralize}".to_sym, options)) + scope = scope.where(Project.allowed_to_condition(user, "view_#{self.name.underscore.pluralize}".to_sym, options)) end scope.all(provider_options[:find_options].dup) |