Skip to content

Commit

Permalink
Merge pull request #2 from darksoul42/master
Browse files Browse the repository at this point in the history
Redmine 3.3.3 compatibility
  • Loading branch information
foton committed Aug 8, 2017
2 parents 0d316fe + 9514a8d commit 7f271d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/controllers/watcher_groups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def destroy
end

def autocomplete_for_group
@groups = Group.active.like(params[:q]).find(:all, :limit => 100)
@groups = Group.sorted.active.like(params[:q]).limit(100)
if @watched
@groups -= @watched.watcher_groups
end
Expand Down
12 changes: 7 additions & 5 deletions lib/watcher_groups_issue_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ def notified_watchers_with_groups
if respond_to?(:visible?)
group_users.reject! {|user| !visible?(user)}
end
notified += group_users
notified |= group_users
end

notified += watcher_users.to_a
notified |= watcher_users.to_a
notified.reject! {|user| user.mail.blank? || user.mail_notification == 'none'}
if respond_to?(:visible?)
notified.reject! {|user| !visible?(user)}
end
notified.uniq
notified
end

def watched_by_with_groups?(user)
Expand All @@ -108,10 +108,12 @@ def watched_by_with_groups?(user)

def watcher_users_with_users
users = watcher_users_without_users
old_object = users
watcher_groups.each do |g|
users += g.users
users |= g.users
end if self.id?
users.uniq
users.define_singleton_method(:reset) do old_object.reset end if old_object.class != users.class
users
end
end
end
Expand Down

0 comments on commit 7f271d2

Please sign in to comment.