<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>Recent Posts in Everyday Active Record | Pragmatic Forums</title>
    <link>http://forums.pragprog.com/forums/74/posts</link>
    <language>en-us</language>
    <ttl>60</ttl>
    <item>
      <title>what tool do you use? posted by Ryan Bates @ Tue, 28 Oct 2008 23:02:42 -0000</title>
      <description>&lt;p&gt;Hi Frank,&lt;/p&gt;


	&lt;p&gt;Sorry for not responding sooner. I&amp;#8217;m using OmniGraffle Pro to generate the diagrams in the episodes. It&amp;#8217;s a great application and highly recommended.&lt;/p&gt;


	&lt;p&gt;Regards,&lt;/p&gt;


	&lt;p&gt;Ryan&lt;/p&gt;</description>
      <pubDate>Tue, 28 Oct 2008 23:02:42 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:1137:5694</guid>
      <author>Ryan Bates</author>
      <link>http://forums.pragprog.com/forums/74/topics/1137</link>
    </item>
    <item>
      <title>Direct route to the home page posted by Ryan Bates @ Tue, 28 Oct 2008 23:01:46 -0000</title>
      <description>&lt;p&gt;Hi Oliver,&lt;/p&gt;


	&lt;p&gt;Sorry for not responding to you sooner. To get this to work make sure you remove the default public/index.html file. After that it should work.&lt;/p&gt;


	&lt;p&gt;Regards,&lt;/p&gt;


	&lt;p&gt;Ryan&lt;/p&gt;</description>
      <pubDate>Tue, 28 Oct 2008 23:01:46 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:1080:5693</guid>
      <author>Ryan Bates</author>
      <link>http://forums.pragprog.com/forums/74/topics/1080</link>
    </item>
    <item>
      <title>what tool do you use? posted by Frank @ Mon, 13 Oct 2008 18:14:59 -0000</title>
      <description>&lt;p&gt;Hi,
 I&amp;#8217;m curious to know what tool is used to generate the notes and diagrams used in these screencasts?&lt;/p&gt;


	&lt;p&gt;- thanks,&lt;br /&gt;Francois&lt;/p&gt;</description>
      <pubDate>Mon, 13 Oct 2008 18:14:59 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:1137:5256</guid>
      <author>Frank</author>
      <link>http://forums.pragprog.com/forums/74/topics/1137</link>
    </item>
    <item>
      <title>Direct route to the home page posted by Olivier P. Rouchard @ Thu, 09 Oct 2008 12:07:54 -0000</title>
      <description>&lt;p&gt;On any of your cinema site, the root &lt;span class="caps"&gt;URL&lt;/span&gt; directs directly to the &amp;#8216;movies&amp;#8217; action.&lt;br /&gt;&lt;pre&gt;&lt;code&gt;  map.resources :movies, :reviews, :theaters
  map.root :controller =&amp;gt; 'movies'&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;


	&lt;p&gt;I can&amp;#8217;t manage to do the same with my applications. Is it the only code to add, or is there something more ?&lt;/p&gt;


	&lt;p&gt;Thank you again for these great movies.&lt;/p&gt;</description>
      <pubDate>Thu, 09 Oct 2008 12:07:54 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:1080:5030</guid>
      <author>Olivier P. Rouchard</author>
      <link>http://forums.pragprog.com/forums/74/topics/1080</link>
    </item>
    <item>
      <title>Populator: Could not find RubyGem echoe (&amp;gt;= 0) posted by Joe Chesak @ Sat, 13 Sep 2008 19:59:55 -0000</title>
      <description>&lt;p&gt;Ryan,&lt;/p&gt;


	&lt;p&gt;That worked; all is well. Thanks!&lt;/p&gt;


	&lt;p&gt;I tweaked the migration as you described.  After that, it helped to wipe out the database first and start fresh:&lt;/p&gt;


	&lt;p&gt;In MySQL:&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;DROP DATABASE cinemas_staging;
CREATE DATABASE cinemas_staging;&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;In cinemas/ directory:&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;rake db:migrate RAILS_ENV=staging
rake db:populate RAILS_ENV=staging&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Sat, 13 Sep 2008 19:59:55 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:919:4529</guid>
      <author>Joe Chesak</author>
      <link>http://forums.pragprog.com/forums/74/topics/919</link>
    </item>
    <item>
      <title>Populator: Could not find RubyGem echoe (&amp;gt;= 0) posted by Ryan Bates @ Fri, 12 Sep 2008 14:51:24 -0000</title>
      <description>&lt;p&gt;Oops, seems there&amp;#8217;s a problem in the code. Thanks for finding that. I&amp;#8217;ve sent in an update so it should be fixed soon. In the meantime you just need to change starts_at and ends_at in the showings migration to starts_on and ends_on. Then run &amp;#8220;rake db:migrate:reset&amp;#8221; (which will recreate the table). Let me know if that doesn&amp;#8217;t work.&lt;/p&gt;</description>
      <pubDate>Fri, 12 Sep 2008 14:51:24 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:919:4519</guid>
      <author>Ryan Bates</author>
      <link>http://forums.pragprog.com/forums/74/topics/919</link>
    </item>
    <item>
      <title>Populator: Could not find RubyGem echoe (&amp;gt;= 0) posted by Joe Chesak @ Fri, 12 Sep 2008 09:54:52 -0000</title>
      <description>&lt;p&gt;Ryan,&lt;/p&gt;


	&lt;p&gt;I am using a clean drop of the code for Episode 5, and I am also experiencing an error with that gem.  Is this actually a problem with the &amp;#8216;Showing&amp;#8217; model? ...&lt;/p&gt;


	&lt;p&gt;&lt;sub&gt;/cinemas&amp;gt;  rake db:populate &lt;span class="caps"&gt;RAILS&lt;/span&gt;_ENV=staging&lt;br /&gt;(in /Users/joe/cinemas)&lt;br /&gt;rake aborted!&lt;br /&gt;undefined method `starts_on=&amp;#8217; for #&amp;lt;populator::record:0x1ec6b60&gt;&lt;/p&gt;


(See full trace by running task with&amp;#8212;trace)&lt;br /&gt;&lt;/sub&gt;/cinemas&amp;gt;  rake db:populate &lt;span class="caps"&gt;RAILS&lt;/span&gt;_ENV=staging&amp;#8212;trace&lt;br /&gt;(in /Users/joe/cinemas)
	&lt;ul&gt;
	&lt;li&gt;Invoke db:populate (first_time)&lt;/li&gt;
		&lt;li&gt;Invoke environment (first_time)&lt;/li&gt;
		&lt;li&gt;Execute environment&lt;/li&gt;
		&lt;li&gt;Execute db:populate&lt;br /&gt;rake aborted!&lt;br /&gt;undefined method `starts_on=&amp;#8217; for #&amp;lt;populator::record:0x1ef2a94&gt;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/record.rb:57:in `method_missing&amp;#8217;&lt;br /&gt;/Users/joe/cinemas/lib/tasks/populate.rake:28&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:53:in `call&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:53:in `build_records&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:50:in `times&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:50:in `build_records&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:43:in `populate&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:29:in `remember_depth&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:42:in `populate&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/model_additions.rb:25:in `populate&amp;#8217;&lt;br /&gt;/Users/joe/cinemas/lib/tasks/populate.rake:25&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:53:in `call&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:53:in `build_records&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:50:in `times&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:50:in `build_records&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:43:in `populate&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:29:in `remember_depth&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:42:in `populate&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/model_additions.rb:25:in `populate&amp;#8217;&lt;br /&gt;/Users/joe/cinemas/lib/tasks/populate.rake:22&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in `invoke_with_call_chain&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in `invoke_task&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in `top_level&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run&amp;#8217;&lt;br /&gt;/Library/Ruby/Gems/1.8/gems/rake-0.8.1/bin/rake:31&lt;br /&gt;/usr/bin/rake:19:in `load&amp;#8217;&lt;br /&gt;/usr/bin/rake:19&lt;br /&gt;~/cinemas&amp;gt;&lt;/li&gt;
	&lt;/ul&gt;</description>
      <pubDate>Fri, 12 Sep 2008 09:54:52 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:919:4517</guid>
      <author>Joe Chesak</author>
      <link>http://forums.pragprog.com/forums/74/topics/919</link>
    </item>
    <item>
      <title>Embedding a SELECT statements posted by Alexander Jolovic @ Tue, 09 Sep 2008 20:16:07 -0000</title>
      <description>&lt;p&gt;Ryan;&lt;/p&gt;


	&lt;p&gt;I appreciate your prompt reply and a thorough one too. I shall give it a try to your suggestions and see what fits the best in my app.&lt;/p&gt;


	&lt;p&gt;Thank you.&lt;/p&gt;


	&lt;p&gt;-Alex&lt;/p&gt;</description>
      <pubDate>Tue, 09 Sep 2008 20:16:07 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:928:4476</guid>
      <author>Alexander Jolovic</author>
      <link>http://forums.pragprog.com/forums/74/topics/928</link>
    </item>
    <item>
      <title>Embedding a SELECT statements posted by Ryan Bates @ Tue, 09 Sep 2008 18:34:56 -0000</title>
      <description>&lt;p&gt;Hi Alex,&lt;/p&gt;


	&lt;p&gt;Rails doesn&amp;#8217;t provide a pretty way to do subqueries, but it&amp;#8217;s just plain &lt;span class="caps"&gt;SQL&lt;/span&gt; so you can embed it directly. This is untested, but I believe you can use the :from option to do this.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
Person.find(:all, :from =&amp;gt; 'people, (SELECT ...)')
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;You can also put a subquery in :joins or :conditions depending on your needs. If all else fails, you can fall back to &lt;code&gt;find_by_sql&lt;/code&gt; where you just pass a plain query.&lt;/p&gt;</description>
      <pubDate>Tue, 09 Sep 2008 18:34:56 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:928:4475</guid>
      <author>Ryan Bates</author>
      <link>http://forums.pragprog.com/forums/74/topics/928</link>
    </item>
    <item>
      <title>:include vs. :joins posted by Ryan Bates @ Tue, 09 Sep 2008 18:26:22 -0000</title>
      <description>&lt;p&gt;Hi James,&lt;/p&gt;


	&lt;p&gt;That&amp;#8217;s a good question. The :select option generally does &lt;strong&gt;not&lt;/strong&gt; work with :include, so you&amp;#8217;ll have to use :joins. However :joins does not instantiate the associated models so I doubt that will do what you want either. &lt;span class="caps"&gt;AFAIK&lt;/span&gt;, this is a limitation of Active Record. There doesn&amp;#8217;t seem to be an easy solution to this, so I&amp;#8217;d say the slight speed boost from :select isn&amp;#8217;t worth the trouble here.&lt;/p&gt;


	&lt;p&gt;That said, there may be some way to do this that I&amp;#8217;m not seeing, or it may be added in the future. You may want to ask the question on the Rails mailing list.&lt;/p&gt;</description>
      <pubDate>Tue, 09 Sep 2008 18:26:22 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:910:4474</guid>
      <author>Ryan Bates</author>
      <link>http://forums.pragprog.com/forums/74/topics/910</link>
    </item>
    <item>
      <title>Populator: Could not find RubyGem echoe (&amp;gt;= 0) posted by Ryan Bates @ Tue, 09 Sep 2008 18:15:49 -0000</title>
      <description>&lt;p&gt;This was a problem with my populator gem. Echoe isn&amp;#8217;t supposed to be a gem dependency, but looks like something is hosed in my gem config. I think I fixed it, so the latest populator version (0.2.4) should work without echoe installed.&lt;/p&gt;


	&lt;p&gt;The mysql problem is unrelated. It looks like the root MySQL user has a password. You&amp;#8217;ll need to set that password in your config/database.yml file. Hopefully that will solve your problem.&lt;/p&gt;</description>
      <pubDate>Tue, 09 Sep 2008 18:15:49 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:919:4472</guid>
      <author>Ryan Bates</author>
      <link>http://forums.pragprog.com/forums/74/topics/919</link>
    </item>
    <item>
      <title>Validating multiple sub-models posted by David Blankenship @ Tue, 09 Sep 2008 16:51:11 -0000</title>
      <description>&lt;p&gt;Oh, I believe &lt;a href="http://forums.pragprog.com/forums/74/topics/628"&gt;Customizing Error Messages&lt;/a&gt; might have answered this.  Sorry if this is a duplicate question.&lt;/p&gt;</description>
      <pubDate>Tue, 09 Sep 2008 16:51:11 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:930:4470</guid>
      <author>David Blankenship</author>
      <link>http://forums.pragprog.com/forums/74/topics/930</link>
    </item>
    <item>
      <title>Validating multiple sub-models posted by David Blankenship @ Tue, 09 Sep 2008 16:49:01 -0000</title>
      <description>&lt;p&gt;Regarding your validation screencast, in the case where you would have inserted (or changed) two or more showings that do not pass validation, it then displays &amp;#8216;Showings are invalid&amp;#8217; once for each sub-model that did not pass.  Is there a clever way to remove the duplication; possibly by doing this as a &amp;#8217;:validate&amp;#8217; and then add the error if it doesn&amp;#8217;t already contain an error on &amp;#8217;:showings&amp;#8217;?  I have seen some solutions which entail looping through the errors array at the end of the model validation and stripping them out, but it seems very ugly.&lt;/p&gt;</description>
      <pubDate>Tue, 09 Sep 2008 16:49:01 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:930:4469</guid>
      <author>David Blankenship</author>
      <link>http://forums.pragprog.com/forums/74/topics/930</link>
    </item>
    <item>
      <title>Embedding a SELECT statements posted by Alexander Jolovic @ Tue, 09 Sep 2008 02:48:22 -0000</title>
      <description>&lt;p&gt;Hi Ryan:&lt;/p&gt;


	&lt;p&gt;How do you embed &lt;span class="caps"&gt;SELECT&lt;/span&gt; statements in a find method? In an &lt;span class="caps"&gt;SQL&lt;/span&gt; statement you will do it in the &lt;span class="caps"&gt;FROM&lt;/span&gt; clause, but I don&amp;#8217;t know if Rails supports embedded &lt;span class="caps"&gt;SELECT&lt;/span&gt; statements.&lt;/p&gt;


	&lt;p&gt;Thanks,&lt;br /&gt;Alex&lt;/p&gt;</description>
      <pubDate>Tue, 09 Sep 2008 02:48:22 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:928:4465</guid>
      <author>Alexander Jolovic</author>
      <link>http://forums.pragprog.com/forums/74/topics/928</link>
    </item>
    <item>
      <title>Populator: Could not find RubyGem echoe (&amp;gt;= 0) posted by Neil Cauldwell @ Sat, 06 Sep 2008 09:06:00 -0000</title>
      <description>&lt;p&gt;I bought the latest episode on the day it was released and really enjoyed it. I&amp;#8217;ve just started implementing the techniques in a current project, but, my setup seems to be having some problems running the Populator gem. When I run the rake db:populate, I see the following error (the gem is installed);&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
rake aborted!
Could not find RubyGem echoe (&amp;gt;= 0)
&lt;/pre&gt;&lt;/code&gt;

	&lt;p&gt;This happens in any Rails environment, on my own app, and on the cinemas app code I downloaded. I haven&amp;#8217;t noticed issues with any other gems yet. The only issues I could possibly relate to it are;&lt;/p&gt;


	&lt;p&gt;1. I recently updated my RubyGems&amp;#8212;system (although no other problems since) &lt;br /&gt;2. script/dbconsole has issues with the mysql setup;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt; 
Neil$ script/dbconsole
Couldn't find database client: mysql5, mysql. Check your $PATH and try
again. &lt;/pre&gt;&lt;/code&gt;

	&lt;p&gt;...and I just followed an instruction on the Hivelogic MySQL installation &amp;#8211; it seems as though Rails can, at least, find the path to mysql, but it still won&amp;#8217;t load dbconsole;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
Neil$ script/dbconsole
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)&lt;/pre&gt;&lt;/code&gt;

	&lt;p&gt;MySql has been running ok despite this (except it seems to have been swapping foreign_keys from &lt;span class="caps"&gt;INT&lt;/span&gt; to &lt;span class="caps"&gt;BIGINT&lt;/span&gt; on this project &amp;#8211; but not all my apps) and I can run all usual DB related rake/script commands without any issues (and the database.yml file is using passwords and the correct user name for mysql).&lt;/p&gt;


	&lt;p&gt;I don&amp;#8217;t know if either of those are related but, maybe they&amp;#8217;ll help in the troubleshooting. Any ideas?&lt;/p&gt;</description>
      <pubDate>Sat, 06 Sep 2008 09:06:00 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:919:4440</guid>
      <author>Neil Cauldwell</author>
      <link>http://forums.pragprog.com/forums/74/topics/919</link>
    </item>
    <item>
      <title>:include vs. :joins posted by James Miller @ Wed, 03 Sep 2008 16:58:51 -0000</title>
      <description>&lt;p&gt;Hey Ryan,&lt;br /&gt;Curious if you have any suggestions for when you do need to include an association (and its data), but don&amp;#8217;t need all the columns of the associated data (or the parent data).  Does the :select method work when using :joins and :includes?  Is it typically not worth it to exclude the unneeded columns?&lt;/p&gt;


	&lt;p&gt;Thanks,&lt;br /&gt;James&lt;/p&gt;</description>
      <pubDate>Wed, 03 Sep 2008 16:58:51 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:910:4408</guid>
      <author>James Miller</author>
      <link>http://forums.pragprog.com/forums/74/topics/910</link>
    </item>
    <item>
      <title>Welcome posted by Philip Cutting @ Sun, 24 Aug 2008 18:08:15 -0000</title>
      <description>&lt;p&gt;Hi Ryan,  I&amp;#8217;m a huge fan of your work!  It&amp;#8217;s helped me immensely!  Please keep it up.  I&amp;#8217;m very excited to see your next screen cast on optimization.   It is very helpful how you discuss use of models.&lt;/p&gt;


	&lt;p&gt;I would love to see more on :join, :from , sub-selects or nested &lt;span class="caps"&gt;SQL&lt;/span&gt;.   Maybe something on dbconsole, and creating aggregates with data from one and many models.  Also your thoughts on injecting &lt;span class="caps"&gt;SQL&lt;/span&gt;, choice of database server,  and stored procedures.&lt;/p&gt;


	&lt;p&gt;Thanks!!&lt;/p&gt;</description>
      <pubDate>Sun, 24 Aug 2008 18:08:15 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:463:4304</guid>
      <author>Philip Cutting</author>
      <link>http://forums.pragprog.com/forums/74/topics/463</link>
    </item>
    <item>
      <title>Confused on how to follow along posted by Ryan Bates @ Fri, 15 Aug 2008 19:04:43 -0000</title>
      <description>&lt;p&gt;Hi Dan,&lt;/p&gt;


	&lt;p&gt;If you downloaded the provided source code, you can load some initial data from the fixtures with this rake command.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
rake db:fixtures:load
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Sorry I didn&amp;#8217;t mention this on the video. It isn&amp;#8217;t intended to be a complete walk-through, follow along tutorial. This is because Rails applications can get very complex and to show how to set up everything from scratch can take away from the topic at hand. But that&amp;#8217;s no excuse for not creating some initial content in the database since that applied to the current topic.&lt;/p&gt;


	&lt;p&gt;Thanks for your feedback.&lt;/p&gt;</description>
      <pubDate>Fri, 15 Aug 2008 19:04:43 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:825:4159</guid>
      <author>Ryan Bates</author>
      <link>http://forums.pragprog.com/forums/74/topics/825</link>
    </item>
    <item>
      <title>Confused on how to follow along posted by Dan Steinicke @ Fri, 15 Aug 2008 18:25:59 -0000</title>
      <description>&lt;p&gt;I enjoyed watching your first episode, and learned a few things from watching it, but was somewhat confused by how I am supposed to follow along.&lt;/p&gt;


	&lt;p&gt;In the video you use the generate script to create the models, so I figured if I wanted to follow along I should create a new rails app in the terminal and do the generates with you.  This works fine until the part where you start using script/console.  When I try to do this no data has yet been added so the console commands don&amp;#8217;t work because there are no movies or theaters in the database.&lt;/p&gt;


	&lt;p&gt;If instead of creating a new rails app I use the downloadable files the console commands work, but the generate script doesn&amp;#8217;t because all the files are already there and the model files already have associations in them.&lt;/p&gt;


	&lt;p&gt;Is there a way I could have set the files up to be able to follow along with the video?  Am I missing some instructions on how you are supposed to set things up so you can follow along with the video?&lt;/p&gt;</description>
      <pubDate>Fri, 15 Aug 2008 18:25:59 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:825:4157</guid>
      <author>Dan Steinicke</author>
      <link>http://forums.pragprog.com/forums/74/topics/825</link>
    </item>
    <item>
      <title>if no row id in association table? posted by Stuart Fraser @ Sun, 10 Aug 2008 13:28:22 -0000</title>
      <description>&lt;p&gt;Aha.&lt;/p&gt;


	&lt;p&gt;As I am new I didn&amp;#8217;t realise that I needed to remove the :index =&amp;gt; option from the text_field rendering&lt;/p&gt;


	&lt;p&gt;I still don&amp;#8217;t really understand the following snippet though.&lt;/p&gt;


&lt;code&gt;:index =&amp;gt; (pages_question.new_record? ? '' : nil)&lt;/code&gt;

	&lt;p&gt;Anyway, I have it all working now.&lt;/p&gt;</description>
      <pubDate>Sun, 10 Aug 2008 13:28:22 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:789:4033</guid>
      <author>Stuart Fraser</author>
      <link>http://forums.pragprog.com/forums/74/topics/789</link>
    </item>
    <item>
      <title>if no row id in association table? posted by Stuart Fraser @ Sun, 10 Aug 2008 08:33:01 -0000</title>
      <description>&lt;p&gt;I must point out that I can add the first entry without this row id. It just has issues when updating because I need to update fields with a &amp;#8220;WHERE page_id = &amp;#8216;1&amp;#8217; &lt;span class="caps"&gt;AND&lt;/span&gt; question_id =&amp;#8217;4&amp;#8217;&amp;#8221;&lt;/p&gt;


	&lt;p&gt;&lt;span class="caps"&gt;UPDATE&lt;/span&gt;&lt;/p&gt;


	&lt;p&gt;I have put a row id in to make accessing each row easier. Now I have another issue. If I use a text_field for my version of the &amp;#8216;showing&amp;#8217; form I don&amp;#8217;t get an id in the &lt;code&gt;name="page[existing_pages_question_attributes][][order]"&lt;/code&gt; and submitting this gives me a 500 internal server error and says something about a clash between a hash and an array. If I manually add one then the select ends up with an extra &lt;code&gt;[1][][select]&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;Once I have fixed adding this index depending on what type I have then everything works. Checked it all out with firebug.&lt;/p&gt;


	&lt;p&gt;Regards&lt;/p&gt;</description>
      <pubDate>Sun, 10 Aug 2008 08:33:01 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:789:4031</guid>
      <author>Stuart Fraser</author>
      <link>http://forums.pragprog.com/forums/74/topics/789</link>
    </item>
    <item>
      <title>if no row id in association table? posted by Stuart Fraser @ Sun, 10 Aug 2008 08:24:16 -0000</title>
      <description>&lt;p&gt;I have been following some other tutorials and examples where the id is not used on an association table. However in the example code here the association table seems to rely on the row id.&lt;/p&gt;


	&lt;p&gt;def existing_showing_attributes=(showing_attributes)&lt;br /&gt;...
   attributes = showing_attributes[showing.id.to_s]&lt;br /&gt;...&lt;br /&gt;end&lt;/p&gt;


	&lt;p&gt;My association table doesn&amp;#8217;t have a row_id, can I still implement this? I am not quite sure how to proceed.&lt;/p&gt;


	&lt;p&gt;I am showing all questions for a page /pages/1/&lt;br /&gt;My pages_questions table is [page_id:int, question_id:int, order:int]&lt;/p&gt;


	&lt;p&gt;{&amp;#8220;commit&amp;#8221;=&amp;gt;&amp;#8221;Submit&amp;#8221;,
 &amp;#8220;_method&amp;#8221;=&amp;gt;&amp;#8221;put&amp;#8221;,
 &amp;#8220;authenticity_token&amp;#8221;=&amp;gt;&amp;#8221;211f1b03d550457151247a05219dac12324083a9&amp;#8221;,
 &amp;#8220;id&amp;#8221;=&amp;gt;&amp;#8221;1&amp;#8221;,
 &amp;#8220;page&amp;#8221;=&amp;gt;{&amp;#8220;existing_pages_question_attributes&amp;#8221;=&amp;gt;[{&amp;#8220;question_id&amp;#8221;=&amp;gt;&amp;#8221;1&amp;#8221;,
 &amp;#8220;page_id&amp;#8221;=&amp;gt;&amp;#8221;1&amp;#8221;,
 &amp;#8220;order&amp;#8221;=&amp;gt;&amp;#8221;1&amp;#8221;},
 {&amp;#8220;question_id&amp;#8221;=&amp;gt;&amp;#8221;2&amp;#8221;,
 &amp;#8220;page_id&amp;#8221;=&amp;gt;&amp;#8221;1&amp;#8221;,
 &amp;#8220;order&amp;#8221;=&amp;gt;&amp;#8221;1&amp;#8221;}]}}&lt;/p&gt;


	&lt;p&gt;Can I use your example without a row id?&lt;br /&gt;Thanks&lt;/p&gt;</description>
      <pubDate>Sun, 10 Aug 2008 08:24:16 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:789:4030</guid>
      <author>Stuart Fraser</author>
      <link>http://forums.pragprog.com/forums/74/topics/789</link>
    </item>
    <item>
      <title>validates_associated posted by Chris Koerner @ Tue, 29 Jul 2008 18:07:10 -0000</title>
      <description>&lt;p&gt;Fixing validates_associated seems like a job for &lt;span class="caps"&gt;SUPER RYAN&lt;/span&gt; &amp;#8211; &lt;span class="caps"&gt;PATCH SUBMITTER OF RAILS CORE&lt;/span&gt;!! For truth, justice, and the common rails developer!&lt;/p&gt;


	&lt;p&gt;:)&lt;/p&gt;</description>
      <pubDate>Tue, 29 Jul 2008 18:07:10 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:732:3831</guid>
      <author>Chris Koerner</author>
      <link>http://forums.pragprog.com/forums/74/topics/732</link>
    </item>
    <item>
      <title>validates_associated posted by Ryan Bates @ Mon, 28 Jul 2008 23:16:29 -0000</title>
      <description>&lt;p&gt;I think there&amp;#8217;s a lot of improvements that can be made regarding how Rails handles validations across associations. This included.&lt;/p&gt;


	&lt;p&gt;Looks like your solution would work (if you do self[:book_id]=), but I like to keep validations outside of the accessor methods. This way I can provide a more descriptive error message if I need. A custom validation might look like this:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
validate :book_must_exist

def book_must_exist
  errors.add(:book_id, "must point to an existing book") if book_id &amp;#38;&amp;#38; book.nil?
end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Why doesn&amp;#8217;t validates_associated do this? I don&amp;#8217;t know, seems like it should.&lt;/p&gt;</description>
      <pubDate>Mon, 28 Jul 2008 23:16:29 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:732:3825</guid>
      <author>Ryan Bates</author>
      <link>http://forums.pragprog.com/forums/74/topics/732</link>
    </item>
    <item>
      <title>episode 4 - counter_cache gotcha posted by Ryan Bates @ Mon, 28 Jul 2008 23:03:33 -0000</title>
      <description>&lt;p&gt;Yeah, if you use update_attribute or something similar it&amp;#8217;s important to reset the column information after adding the column. This is because Rails caches the columns and it doesn&amp;#8217;t know if you added one.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
Movie.reset_column_information
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;However, with Rails 2.1 I&amp;#8217;ve noticed this sometimes doesn&amp;#8217;t work. I think it has to do with dirty tracking, but I was never able to reliably duplicate the problem so I don&amp;#8217;t know what it was exactly.&lt;/p&gt;</description>
      <pubDate>Mon, 28 Jul 2008 23:03:33 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:74:725:3824</guid>
      <author>Ryan Bates</author>
      <link>http://forums.pragprog.com/forums/74/topics/725</link>
    </item>
  </channel>
</rss>
