Sha256: aa50fdfbd415fa82794b52e6c31be0ed8b55470b236857715f81a24348ba4478
Contents?: true
Size: 1.01 KB
Versions: 10
Compression:
Stored size: 1.01 KB
Contents
module Workarea decorate Admin::CatalogProductsController, with: :product_additional_details do decorated do # Place code to decorate here that would normally go on the class # level, e.g.: # # field :name, type: String end class_methods do # Place methods to define on the class level here. These methods # will be available by calling Admin::CatalogProductsController.your_method. Do # not prefix these methods with `self.` end def update set_additional_details super end def set_additional_details @product.additional_details = HashUpdate.new( original: @product.additional_details, adds: params[:new_additional_details], updates: params[:additional_details], removes: params[:additional_details_to_remove] ).result_grouped end # Instance methods can go right in the main definition of the # decorator, as it is a module that gets prepended into the class of # your choice. end end
Version data entries
10 entries across 10 versions & 1 rubygems