Class: RestaurantTagCpt::Operations::Create
- Inherits:
-
Trailblazer::Operation
- Object
- Trailblazer::Operation
- RestaurantTagCpt::Operations::Create
- Defined in:
- app/concepts/restaurant_tag_cpt/operations/create.rb
Instance Method Summary collapse
Instance Method Details
#find_model!(options) ⇒ Object
12 13 14 |
# File 'app/concepts/restaurant_tag_cpt/operations/create.rb', line 12 def find_model!(, *) ['model'] = ::RestaurantTagCpt::ModelDecorator.new end |
#map_attributes!(options) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/concepts/restaurant_tag_cpt/operations/create.rb', line 16 def map_attributes!(, *) MyLocaleManager.available_locales.each do |locale| tag_value = [::OpCons::CONTRACT_DEFAULT].send("tag_#{locale}").to_s.strip title = if tag_value.blank? nil else "#{[::OpCons::CONTRACT_DEFAULT].category}:#{tag_value}" end [::OpCons::MODEL].send(:"title_#{locale}=", title) end end |