<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>spitfire_tree</author_name>
  <author_url>https://blog.hatena.ne.jp/spitfire_tree/</author_url>
  <blog_title>happy lie, happy life</blog_title>
  <blog_url>https://spitfire-tree.hatenadiary.org/</blog_url>
  <categories>
    <anon>Ruby</anon>
    <anon>Rails</anon>
  </categories>
  <description>あるテーブルのすべてのフラグを false にしたい時に、件数が多くなる事が予想されたので1000件ずつ処理しようと考え、次のようなコードを書きました。 while Hoge.where(&quot;flag IS true&quot;).count &gt; 0 sql = &quot;UPDATE hoge SET flag = false WHERE flag IS true LIMIT 1000&quot; Hoge.connection.execute(sql) end 一見正しく動作しそうなのですが、このまま動かすと見事に無限ループになります。ログを確認すると次のような気になる箇所を発見。 CACHE (0.0ms) SELE…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fspitfire-tree.hatenadiary.org%2Fentry%2F20120524%2F1337841949&quot; title=&quot;ActiveRecord のキャッシュをオフにする - happy lie, happy life&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2012-05-24 15:45:49</published>
  <title>ActiveRecord のキャッシュをオフにする</title>
  <type>rich</type>
  <url>https://spitfire-tree.hatenadiary.org/entry/20120524/1337841949</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
