Class: Workarea::Api::Admin::PaymentProfilesController
Instance Method Summary
collapse
#current_user, #sort_direction, #sort_field
Instance Method Details
#bulk ⇒ Object
283
284
285
286
287
288
289
290
|
# File 'app/controllers/workarea/api/admin/payment_profiles_controller.rb', line 283
def bulk
@bulk = Api::Admin::BulkUpsert.create!(
klass: Payment::Profile,
data: params[:payment_profiles].map(&:to_h)
)
head :no_content
end
|
#create ⇒ Object
106
107
108
109
110
111
112
113
|
# File 'app/controllers/workarea/api/admin/payment_profiles_controller.rb', line 106
def create
@payment_profile = Payment::Profile.create!(params[:payment_profile])
respond_with(
{ payment_profile: @payment_profile },
{ status: :created,
location: payment_profile_path(@payment_profile) }
)
end
|
#destroy ⇒ Object
292
293
294
295
|
# File 'app/controllers/workarea/api/admin/payment_profiles_controller.rb', line 292
def destroy
@payment_profile.destroy
head :no_content
end
|
#index ⇒ Object
97
98
99
100
101
102
103
104
|
# File 'app/controllers/workarea/api/admin/payment_profiles_controller.rb', line 97
def index
@payment_profiles = Payment::Profile
.all
.order_by(sort_field => sort_direction)
.page(params[:page])
respond_with payment_profiles: @payment_profiles
end
|
#show ⇒ Object
245
246
247
|
# File 'app/controllers/workarea/api/admin/payment_profiles_controller.rb', line 245
def show
respond_with payment_profile: @payment_profile
end
|
#update ⇒ Object
249
250
251
252
|
# File 'app/controllers/workarea/api/admin/payment_profiles_controller.rb', line 249
def update
@payment_profile.update_attributes!(params[:payment_profile])
respond_with payment_profile: @payment_profile
end
|