Skip to content

Commit

Permalink
added redirect back to organization as a temporary solution for bug #201
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce Lin committed Mar 6, 2017
1 parent a9e7b24 commit a63ef18
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion app/controllers/charges_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
# ## Schema Information
#
# Table name: `charges`
#
# ### Columns
#
# Name | Type | Attributes
# ------------------------------- | ------------------ | ---------------------------
# **`amount`** | `decimal(8, 2)` |
# **`charge_type_id`** | `integer` |
# **`charged_at`** | `datetime` |
# **`created_at`** | `datetime` |
# **`creating_participant_id`** | `integer` |
# **`description`** | `text(65535)` |
# **`id`** | `integer` | `not null, primary key`
# **`is_approved`** | `boolean` |
# **`issuing_participant_id`** | `integer` |
# **`organization_id`** | `integer` |
# **`receiving_participant_id`** | `integer` |
# **`updated_at`** | `datetime` |
#
# ### Indexes
#
# * `index_charges_on_organization_id`:
# * **`organization_id`**
#

class ChargesController < ApplicationController
load_and_authorize_resource skip_load_resource only: [:create]
before_action :set_charge, only: [:show, :edit, :update, :destroy, :approve]
Expand Down Expand Up @@ -69,7 +96,8 @@ def destroy
def approve
@charge.is_approved = !@charge.is_approved
@charge.save
respond_with @charge, location: -> {charges_path}

respond_with(@charge, location: @charge.organization)
end

private
Expand Down

0 comments on commit a63ef18

Please sign in to comment.