Class: Effective::CustomersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Effective::CustomersController
- Includes:
- CrudController
- Defined in:
- app/controllers/effective/customers_controller.rb
Instance Method Summary collapse
-
#customer_params ⇒ Object
StrongParameters.
- #resource ⇒ Object
-
#save_resource(resource, action, to_assign) ⇒ Object
I don't want save_resource to wrap my save in a transaction.
Instance Method Details
#customer_params ⇒ Object
StrongParameters
22 23 24 |
# File 'app/controllers/effective/customers_controller.rb', line 22 def customer_params params.require(:effective_subscripter).permit(:stripe_token) end |
#resource ⇒ Object
10 11 12 13 |
# File 'app/controllers/effective/customers_controller.rb', line 10 def resource @customer ||= Effective::Customer.where(user: current_user).first! @subscripter ||= Effective::Subscripter.new(customer: @customer, user: @customer.user) end |
#save_resource(resource, action, to_assign) ⇒ Object
I don't want save_resource to wrap my save in a transaction
16 17 18 19 |
# File 'app/controllers/effective/customers_controller.rb', line 16 def save_resource(resource, action, to_assign) resource.assign_attributes(to_assign) resource.save! end |