Skip to content

Commit

Permalink
Merge branch 'master' of github.com:datacite/lupo
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhallett committed Jun 15, 2021
2 parents 6cb0c77 + 5ee307a commit 071e24f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/controllers/clients_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def create
@client.send_welcome_email(responsible_id: current_user.uid)
options = {}
options[:is_collection] = false
options[:params] = { current_ability: current_ability }
options[:params] = { current_ability: current_ability, detail: true }

render json: ClientSerializer.new(@client, options).serialized_json,
status: :created
Expand All @@ -177,7 +177,7 @@ def create
def update
options = {}
options[:is_collection] = false
options[:params] = { current_ability: current_ability }
options[:params] = { current_ability: current_ability, detail: true }

if params.dig(:data, :attributes, :mode) == "transfer"
# only update provider_id
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/contacts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def create
options = {}
options[:include] = @include
options[:is_collection] = false
options[:params] = { current_ability: current_ability }
options[:params] = { current_ability: current_ability, detail: true }

render json: ContactSerializer.new(@contact, options).serialized_json,
status: :created
Expand All @@ -137,7 +137,7 @@ def update
options = {}
options[:include] = @include
options[:is_collection] = false
options[:params] = { current_ability: current_ability }
options[:params] = { current_ability: current_ability, detail: true }

render json: ContactSerializer.new(@contact, options).serialized_json,
status: :ok
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/providers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def create
options = {}
options[:include] = @include
options[:is_collection] = false
options[:params] = { current_ability: current_ability }
options[:params] = { current_ability: current_ability, detail: true }

render json: ProviderSerializer.new(@provider, options).serialized_json,
status: :ok
Expand All @@ -272,7 +272,7 @@ def update
options = {}
options[:include] = @include
options[:is_collection] = false
options[:params] = { current_ability: current_ability }
options[:params] = { current_ability: current_ability, detail: true }

render json: ProviderSerializer.new(@provider, options).serialized_json,
status: :ok
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/repositories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def create
@client.send_welcome_email(responsible_id: current_user.uid)
options = {}
options[:is_collection] = false
options[:params] = { current_ability: current_ability }
options[:params] = { current_ability: current_ability, detail: true }

render json: RepositorySerializer.new(@client, options).serialized_json,
status: :created
Expand All @@ -219,7 +219,7 @@ def create
def update
options = {}
options[:is_collection] = false
options[:params] = { current_ability: current_ability }
options[:params] = { current_ability: current_ability, detail: true }

if params.dig(:data, :attributes, :mode) == "transfer"
# only update provider_id
Expand Down
2 changes: 1 addition & 1 deletion app/serializers/contact_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ContactSerializer
attribute :from_salesforce,
if:
Proc.new { |object, params|
params[:current_ability] &&
params[:detail] && params[:current_ability] &&
params[:current_ability].can?(:read_salesforce_id, object) ==
true
},
Expand Down
2 changes: 1 addition & 1 deletion app/serializers/provider_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ class ProviderSerializer
attribute :from_salesforce,
if:
Proc.new { |object, params|
params[:current_ability] &&
params[:detail] && params[:current_ability] &&
params[:current_ability].can?(:read_salesforce_id, object) ==
true
},
Expand Down
2 changes: 1 addition & 1 deletion app/serializers/repository_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class RepositorySerializer
attribute :from_salesforce,
if:
Proc.new { |object, params|
params[:current_ability] &&
params[:detail] && params[:current_ability] &&
params[:current_ability].can?(:read_salesforce_id, object) ==
true
},
Expand Down

0 comments on commit 071e24f

Please sign in to comment.