Add a writing role to the shortcuts controller
This commit is contained in:
parent
be5fc25544
commit
fea1b9389b
@ -29,7 +29,9 @@ class Api::V1::ShortcutsController < Api::BaseController
|
|||||||
elsif s.shortcut_type == 'account'
|
elsif s.shortcut_type == 'account'
|
||||||
@account = @accounts.detect{ |a| a.id == s.shortcut_id }
|
@account = @accounts.detect{ |a| a.id == s.shortcut_id }
|
||||||
if @account.nil?
|
if @account.nil?
|
||||||
|
ActiveRecord::Base.connected_to(role: :writing) do
|
||||||
s.destroy!
|
s.destroy!
|
||||||
|
end
|
||||||
else
|
else
|
||||||
value = REST::AccountSerializer.new(@account)
|
value = REST::AccountSerializer.new(@account)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user