<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Ruby brothers - &#1054;&#1076;&#1080;&#1085; &#1084;&#1072;&#1083;&#1077;&#1085;&#1100;&#1082;&#1080;&#1081; &#1085;&#1102;&#1072;&#1085;&#1089; :counter_cache Comments</title>
  <id>tag:rubybrothers.ru,2009:/2007/7/18/counter_cache_little_gotcha/comments</id>
  <generator version="0.7.3" uri="http://mephistoblog.com">Mephisto Noh-Varr</generator>
  <link href="http://rubybrothers.ru/2007/7/18/counter_cache_little_gotcha/comments.xml" rel="self" type="application/atom+xml"/>
  <link href="/2007/7/18/counter_cache_little_gotcha" rel="alternate" type="text/html"/>
  <updated>2007-07-24T12:25:51Z</updated>
  <entry xml:base="http://rubybrothers.ru">
    <author>
      <name>Nexus</name>
    </author>
    <id>tag:rubybrothers.ru,2007-07-18:243:246</id>
    <published>2007-07-24T12:25:51Z</published>
    <updated>2007-07-24T12:25:51Z</updated>
    <category term="Ruby on Rails"/>
    <category term="Tips &amp; Tricks"/>
    <category term="&#1053;&#1086;&#1074;&#1080;&#1095;&#1082;&#1091;"/>
    <link href="http://rubybrothers.ru/2007/7/18/counter_cache_little_gotcha" rel="alternate" type="text/html"/>
    <title>Comment on '&#1054;&#1076;&#1080;&#1085; &#1084;&#1072;&#1083;&#1077;&#1085;&#1100;&#1082;&#1080;&#1081; &#1085;&#1102;&#1072;&#1085;&#1089; :counter_cache' by Nexus</title>
<content type="html">&lt;p&gt;Кстати, если иногда при наличии counter_cache, пробуем взять значение счетчика (типа user.posts_count) и получаем запрос в базу &lt;span class=&quot;caps&quot;&gt;SELECT&lt;/span&gt; Count(*) &lt;span class=&quot;caps&quot;&gt;FROM&lt;/span&gt; posts &lt;span class=&quot;caps&quot;&gt;WHERE&lt;/span&gt; user_id = N; Вместо того, чтобы взять из аттрибута user.posts_count&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://rubybrothers.ru">
    <author>
      <name>PartyZan</name>
    </author>
    <id>tag:rubybrothers.ru,2007-07-18:243:245</id>
    <published>2007-07-18T09:30:10Z</published>
    <updated>2007-07-18T09:30:10Z</updated>
    <category term="Ruby on Rails"/>
    <category term="Tips &amp; Tricks"/>
    <category term="&#1053;&#1086;&#1074;&#1080;&#1095;&#1082;&#1091;"/>
    <link href="http://rubybrothers.ru/2007/7/18/counter_cache_little_gotcha" rel="alternate" type="text/html"/>
    <title>Comment on '&#1054;&#1076;&#1080;&#1085; &#1084;&#1072;&#1083;&#1077;&#1085;&#1100;&#1082;&#1080;&#1081; &#1085;&#1102;&#1072;&#1085;&#1089; :counter_cache' by PartyZan</title>
<content type="html">&lt;p&gt;есть еще параметр :null =&amp;gt; false,  который явно указывает на недопустимость &lt;span class=&quot;caps&quot;&gt;NULL&lt;/span&gt; значений в таблице&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://rubybrothers.ru">
    <author>
      <name>PartyZan</name>
    </author>
    <id>tag:rubybrothers.ru,2007-07-18:243:244</id>
    <published>2007-07-18T09:26:16Z</published>
    <updated>2007-07-18T09:26:16Z</updated>
    <category term="Ruby on Rails"/>
    <category term="Tips &amp; Tricks"/>
    <category term="&#1053;&#1086;&#1074;&#1080;&#1095;&#1082;&#1091;"/>
    <link href="http://rubybrothers.ru/2007/7/18/counter_cache_little_gotcha" rel="alternate" type="text/html"/>
    <title>Comment on '&#1054;&#1076;&#1080;&#1085; &#1084;&#1072;&#1083;&#1077;&#1085;&#1100;&#1082;&#1080;&#1081; &#1085;&#1102;&#1072;&#1085;&#1089; :counter_cache' by PartyZan</title>
<content type="html">&lt;p&gt;Что-то с русским языком в &lt;span class=&quot;caps&quot;&gt;RSS&lt;/span&gt; случилось :(&lt;/p&gt;</content>  </entry>
</feed>

