diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb index 875a89d..2314887 100644 --- a/app/controllers/articles_controller.rb +++ b/app/controllers/articles_controller.rb @@ -70,7 +70,7 @@ class ArticlesController < ApplicationController def update @article = @supplier.articles.find(params[:id]) respond_to do |format| - if @article.update_attributes(params[:article]) + if @article.update(params[:article]) flash[:notice] = 'Article was successfully updated.' format.html { redirect_to supplier_article_url(@article.supplier, @article) } format.xml { head :ok } diff --git a/app/controllers/suppliers_controller.rb b/app/controllers/suppliers_controller.rb index 5145c12..dda8c52 100644 --- a/app/controllers/suppliers_controller.rb +++ b/app/controllers/suppliers_controller.rb @@ -64,7 +64,7 @@ class SuppliersController < ApplicationController # don't set password to blank on saving attrs = attrs.reject {|k,v| k == 'ftp_password' } if attrs[:ftp_password].blank? - if @supplier.update_attributes(attrs) + if @supplier.update(attrs) flash[:notice] = 'Supplier was successfully updated.' format.html { redirect_to supplier_url(@supplier) } format.xml { head :ok } diff --git a/app/models/supplier.rb b/app/models/supplier.rb index 38a7011..aa93a85 100644 --- a/app/models/supplier.rb +++ b/app/models/supplier.rb @@ -92,7 +92,7 @@ class Supplier < ActiveRecord::Base # update existing article elsif status.nil? && article - updated_counter += 1 if article.update_attributes(parsed_article) + updated_counter += 1 if article.update(parsed_article) listed << article.id # delete outlisted article diff --git a/db/migrate/20170901200146_add_salt_to_suppliers.rb b/db/migrate/20170901200146_add_salt_to_suppliers.rb index 42cd5c0..5c659e9 100644 --- a/db/migrate/20170901200146_add_salt_to_suppliers.rb +++ b/db/migrate/20170901200146_add_salt_to_suppliers.rb @@ -7,7 +7,7 @@ class AddSaltToSuppliers < ActiveRecord::Migration Supplier.find_each do |supplier| salt = [Array.new(6){rand(256).chr}.join].pack("m").chomp - supplier.update_attributes! salt: salt + supplier.update! salt: salt end change_column_null :suppliers, :salt, false