@@ -57,26 +57,26 module Redmine | |||
|
57 | 57 | scope = self |
|
58 | 58 | |
|
59 | 59 | if from && to |
|
60 |
scope = scope. |
|
|
60 | scope = scope.where("#{provider_options[:timestamp]} BETWEEN ? AND ?", from, to) | |
|
61 | 61 | end |
|
62 | 62 | |
|
63 | 63 | if options[:author] |
|
64 | 64 | return [] if provider_options[:author_key].nil? |
|
65 |
scope = scope. |
|
|
65 | scope = scope.where("#{provider_options[:author_key]} = ?", options[:author].id) | |
|
66 | 66 | end |
|
67 | 67 | |
|
68 | 68 | if options[:limit] |
|
69 | 69 | # id and creation time should be in same order in most cases |
|
70 |
scope = scope. |
|
|
70 | scope = scope.reorder("#{table_name}.id DESC").limit(options[:limit]) | |
|
71 | 71 | end |
|
72 | 72 | |
|
73 | 73 | if provider_options.has_key?(:permission) |
|
74 |
scope = scope. |
|
|
74 | scope = scope.where(Project.allowed_to_condition(user, provider_options[:permission] || :view_project, options)) | |
|
75 | 75 | elsif respond_to?(:visible) |
|
76 | 76 | scope = scope.visible(user, options) |
|
77 | 77 | else |
|
78 | 78 | 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." |
|
79 |
scope = scope. |
|
|
79 | scope = scope.where(Project.allowed_to_condition(user, "view_#{self.name.underscore.pluralize}".to_sym, options)) | |
|
80 | 80 | end |
|
81 | 81 | |
|
82 | 82 | scope.all(provider_options[:find_options].dup) |
General Comments 0
You need to be logged in to leave comments.
Login now