title: Trying to import a CSV file triggers a function which ends up manipulating the data imported into the database
body: <p>Like the question says, I am trying to import a CSV with the following function:</p>
  <pre><code>def import_users
    path = Rails.root.join('somePath')
    CSV.foreach(path, headers: true) do |row|
      usr = User.new(row.to_hash)
      usr.skip_callbacks = true
      usr.save
    end
    puts &quot;inserts on table users complete&quot;
  end
  </code></pre>
  <p>As you can tell, it is a simple function.</p>
  <h2>Issue:</h2>
  <p>All the columns with the correct data are imported correctly but in the <code>User Class</code> the <code>password= function (setter)</code> is triggered:</p>
  <pre><code>class User &lt; ApplicationRecord
  
    attr_accessor :skip_callbacks
    validates :password, presence: true, unless: :skip_callbacks
  
    def password= password
      self[:password] = hash_password password
    end
  
    private
      
    def hash_password password
       Digest::MD5.hexdigest &quot;#{Digest::MD5.hexdigest password}#{salt}&quot;
    end
  end
  </code></pre>
  <blockquote>
  <p>This causes the password column in the database to be rewritten again with <strong>new hashes as passwords</strong> which then prevents login because the column values have changed. The password column in the database does not contain the same info as in the CSV File.</p>
  </blockquote>
  <p>Normally I implemented a <code>skip_callback</code> to bypass <code>password validation</code> but does not seem to work.</p>
  <p>I would really appreciate any kind of help as I have been trying to solve this for a couple of days now and can't seem to figure out why.</p>