title: Rails 4 - Compare data from MySQL and SQLite
body: <p>I'm trying to compare data on my external data and saved data on local Rails db and if something change on external db, also change it on local.</p>
  
  <p>I'm so far here:</p>
  
  <p><strong>MY MODEL</strong></p>
  
  <pre><code>def self.updatedata
     user = Account.updatedata
     stats = Status.all
  
     user.each do |u|
        id = u.accountId
        stats = u.accountStatus
  
        if stats.user_id != id &amp;&amp; stats.user_status != u.stats
            p "It's Changed"
        end
     end
  end
  </code></pre>
  
  <p><strong>Account.update (external)</strong> data I'm getting: <code>Account.select('accountId', 'accountStatus')</code> that saving <code>user_id = accountId, user_status = accountStatus</code></p>
  
  <p>Then im printing <strong>Status.all (local)</strong> there is a <code>id, user_id, user_status, timestamps</code></p>