Class: Workarea::Api::Admin::ReleasesController
Instance Method Summary
collapse
#current_user, #sort_direction, #sort_field
Instance Method Details
#bulk ⇒ Object
282
283
284
285
286
287
288
289
|
# File 'app/controllers/workarea/api/admin/releases_controller.rb', line 282
def bulk
@bulk = Api::Admin::BulkUpsert.create!(
klass: Release,
data: params[:releases].map(&:to_h)
)
head :no_content
end
|
#create ⇒ Object
105
106
107
108
109
110
111
112
|
# File 'app/controllers/workarea/api/admin/releases_controller.rb', line 105
def create
@release = Release.create!(params[:release])
respond_with(
{ release: @release },
{ status: :created,
location: release_path(@release) }
)
end
|
#destroy ⇒ Object
291
292
293
294
|
# File 'app/controllers/workarea/api/admin/releases_controller.rb', line 291
def destroy
@release.destroy
head :no_content
end
|
#index ⇒ Object
97
98
99
100
101
102
103
|
# File 'app/controllers/workarea/api/admin/releases_controller.rb', line 97
def index
@releases = Release
.all
.order_by(sort_field => sort_direction)
.page(params[:page])
respond_with releases: @releases
end
|
#show ⇒ Object
244
245
246
|
# File 'app/controllers/workarea/api/admin/releases_controller.rb', line 244
def show
respond_with release: @release
end
|
#update ⇒ Object
248
249
250
251
|
# File 'app/controllers/workarea/api/admin/releases_controller.rb', line 248
def update
@release.update_attributes!(params[:release])
respond_with release: @release
end
|