Skip to content

Commit

Permalink
create the resource action after save
Browse files Browse the repository at this point in the history
otherwise this fails
  • Loading branch information
d-m-u committed Apr 30, 2020
1 parent 6b31460 commit cb5a8d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/api/custom_buttons_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ def create_resource(_type, _id, data)
custom_button = CustomButton.new(data.except("resource_action", "options"))
custom_button.userid = User.current_user.userid
custom_button.options = data["options"].deep_symbolize_keys if data["options"]
custom_button.create_resource_action!(data["resource_action"].deep_symbolize_keys) if data.key?("resource_action")
custom_button.save!
custom_button.create_resource_action!(data["resource_action"].deep_symbolize_keys) if data.key?("resource_action")
custom_button
end
rescue => err
Expand Down

0 comments on commit cb5a8d3

Please sign in to comment.