diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2018-09-20 11:13:39 +0300 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2019-01-31 15:49:50 +0300 |
commit | ee826ad4a11560e669833cd9df707750a1e86b93 (patch) | |
tree | 901e666ac9b5e1c336d168d23d6fdeef8a6c5c1d /lib/api/group_labels.rb | |
parent | 82f09a91dd3abae48b74010f541ea50e0190276a (diff) |
Replace finders
Diffstat (limited to 'lib/api/group_labels.rb')
-rw-r--r-- | lib/api/group_labels.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/group_labels.rb b/lib/api/group_labels.rb index fb2d7fedb90..d8be226f045 100644 --- a/lib/api/group_labels.rb +++ b/lib/api/group_labels.rb @@ -35,7 +35,7 @@ module API post ':id/labels' do authorize! :admin_label, user_group - label = available_labels_for(user_group).find_by(title: params[:name]) + label = available_labels_for(user_group, { title: params[:name] }) conflict!('Label already exists') if label label = ::Labels::CreateService.new(declared_params(include_missing: false)).execute(group: user_group) @@ -57,7 +57,7 @@ module API delete ':id/labels' do authorize! :admin_label, user_group - label = user_group.labels.find_by(title: params[:name]) + label = available_labels_for(user_group, { title: params[:name] }) not_found!('Label') unless label destroy_conditionally!(label) @@ -77,7 +77,7 @@ module API put ':id/labels' do authorize! :admin_label, user_group - label = user_group.labels.find_by(title: params[:name]) + label = available_labels_for(user_group, { title: params[:name] }) not_found!('Label not found') unless label label = ::Labels::UpdateService.new(declared_params(include_missing: false)).execute(label) |