lib/engine2/meta/delete_meta.rb in engine2-1.0.1 vs lib/engine2/meta/delete_meta.rb in engine2-1.0.2
- old
+ new
@@ -1,10 +1,9 @@
# coding: utf-8
module Engine2
class DeleteMetaBase < Meta
- include MetaModelSupport
def invoke_delete_db handler, ids
begin
model = assets[:model]
model.db.transaction do
@@ -38,31 +37,19 @@
end
end
class DeleteMeta < DeleteMetaBase
- http_method :delete
- meta_type :delete
+ include MetaDeleteSupport
- def pre_run
- super
- action.parent.parent.*.menu(:item_menu).option :confirm_delete, icon: "trash", show: "action.selected_size() == 0", button_loc: false
- end
-
def invoke handler
handler.permit id = handler.params[:id]
invoke_delete_db(handler, [id])
end
end
class BulkDeleteMeta < DeleteMetaBase
- http_method :delete
- meta_type :bulk_delete
-
- def pre_run
- super
- action.parent.parent.*.menu(:menu).option_after :default_order, :confirm_bulk_delete, icon: "trash", show: "action.selected_size() > 0"
- end
+ include MetaBulkDeleteSupport
def invoke handler
ids = handler.param_to_json(:ids)
handler.permit ids.is_a?(Array)
invoke_delete_db(handler, ids)
\ No newline at end of file