diff options
| author | Luc Donnet | 2018-03-28 08:11:33 +0200 |
|---|---|---|
| committer | GitHub | 2018-03-28 08:11:33 +0200 |
| commit | 12d06ea23dc55ffbfe347fc5898f0f9c8a55b45f (patch) | |
| tree | 77f6e60387c44342017e6c6126186ac2e19a24a3 /app/models/user.rb | |
| parent | d3ab2606ffd3dcb94a27d7b4e7c899f1238d3a53 (diff) | |
| parent | ad9a73328828648bc927f711060f5ed90bfcf947 (diff) | |
| download | chouette-core-12d06ea23dc55ffbfe347fc5898f0f9c8a55b45f.tar.bz2 | |
Merge pull request #398 from af83/6259-calendar-mailer
Refs #6259 Only send mails to users from same workgroup after create/…
Diffstat (limited to 'app/models/user.rb')
| -rw-r--r-- | app/models/user.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index d2fdf8f05..eca7ede0c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -30,6 +30,8 @@ class User < ActiveRecord::Base scope :with_organisation, -> { where.not(organisation_id: nil) } + scope :from_workgroup, ->(workgroup_id) { joins(:workbenches).where(workbenches: {workgroup_id: workgroup_id}) } + # Callback invoked by DeviseCasAuthenticable::Model#authernticate_with_cas_ticket def cas_extra_attributes=(extra_attributes) |
