app/controllers/alchemy/admin/attachments_controller.rb in alchemy_cms-3.0.4 vs app/controllers/alchemy/admin/attachments_controller.rb in alchemy_cms-3.1.0.beta1
- old
+ new
@@ -38,21 +38,19 @@
render json: {files: [@attachment.to_jq_upload], growl_message: message}, status: :unprocessable_entity
end
end
def update
- @attachment = Attachment.find(params[:id])
@attachment.update_attributes(attachment_attributes)
render_errors_or_redirect(
@attachment,
admin_attachments_path(page: params[:page], query: params[:query], per_page: params[:per_page]),
_t("File successfully updated")
)
end
def destroy
- @attachment = Attachment.find(params[:id])
name = @attachment.name
@attachment.destroy
@url = admin_attachments_url(
per_page: params[:per_page],
page: params[:page],
@@ -74,11 +72,11 @@
def in_overlay?
params[:content_id].present?
end
def archive_overlay
- @content = Content.select('id').find_by(id: params[:content_id])
+ @content = Content.find_by(id: params[:content_id])
@options = options_from_params
respond_to do |format|
format.html { render partial: 'archive_overlay' }
format.js { render action: 'archive_overlay' }
end
@@ -88,10 +86,10 @@
params.require(:attachment).permit(:file, :name, :file_name, :tag_list)
end
def set_instance_variables
@while_assigning = true
- @content = Content.select('id').find_by(id: params[:content_id])
+ @content = Content.find_by(id: params[:content_id])
@swap = params[:swap]
@options = options_from_params
end
end