Class: Gemgento::Magento::PriceRulesController

Inherits:
BaseController show all
Defined in:
app/controllers/gemgento/magento/price_rules_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#validate_ip

Instance Method Details

#destroyObject



12
13
14
15
16
17
18
# File 'app/controllers/gemgento/magento/price_rules_controller.rb', line 12

def destroy
  if price_rule = PriceRule.find_by(magento_id: params[:id])
    price_rule.destroy
  end

  render nothing: true
end

#updateObject



5
6
7
8
9
10
# File 'app/controllers/gemgento/magento/price_rules_controller.rb', line 5

def update
  if data = params[:data]
    API::SOAP::CatalogRule::Rule.sync_magento_to_local(data, data[:website_ids], data[:customer_group_ids])
  end
  render nothing: true
end