Class: Gemgento::Magento::StoresController

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

Instance Method Summary collapse

Methods inherited from BaseController

#validate_ip

Instance Method Details

#updateObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/gemgento/magento/stores_controller.rb', line 4

def update
  data = params[:data]

  @store = Store.find_or_initialize_by(magento_id: data[:store_id])
  @store.magento_id = source[:store_id]
  @store.code = source[:code]
  @store.website_id = source[:website_id]
  @store.group_id = source[:group_id]
  @store.name = source[:name]
  @store.sort_order = source[:sort_order]
  @store.is_active = source[:is_active]
  @store.save

  render nothing: true
end