@@ -66,8 +66,11 module Redmine | |||||
66 | end |
|
66 | end | |
67 | cond.add(Project.allowed_to_condition(user, provider_options[:permission], options)) if provider_options[:permission] |
|
67 | cond.add(Project.allowed_to_condition(user, provider_options[:permission], options)) if provider_options[:permission] | |
68 | scope_options[:conditions] = cond.conditions |
|
68 | scope_options[:conditions] = cond.conditions | |
69 | scope_options[:order] = "#{provider_options[:timestamp]} DESC" |
|
69 | if options[:limit] | |
70 | scope_options[:limit] = options[:limit] |
|
70 | # id and creation time should be in same order in most cases | |
|
71 | scope_options[:order] = "#{table_name}.id DESC" | |||
|
72 | scope_options[:limit] = options[:limit] | |||
|
73 | end | |||
71 |
|
74 | |||
72 | with_scope(:find => scope_options) do |
|
75 | with_scope(:find => scope_options) do | |
73 | find(:all, provider_options[:find_options]) |
|
76 | find(:all, provider_options[:find_options]) |
General Comments 0
You need to be logged in to leave comments.
Login now