<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>James Robey &#187; Ruby on Rails</title>
	<atom:link href="http://www.jamesrobey.com/category/programming/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jamesrobey.com</link>
	<description>ruby/rails/ppc/seo/4hww/geoarbitrage/vagabond/catamaran/3flags/hydroponics/economics/philosophy/outerspace/etc</description>
	<lastBuildDate>Thu, 12 Aug 2010 23:37:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Weight Lifting for Everyone</title>
		<link>http://www.jamesrobey.com/weight-lifting-for-everyone/</link>
		<comments>http://www.jamesrobey.com/weight-lifting-for-everyone/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 19:54:28 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.jamesrobey.com/?p=134</guid>
		<description><![CDATA[PART 1:
This program is the simplest and greatest weight lifting program for everyone.
But first..  Why weight lift?  Should everyone weight lift?
Absolutely!  Weight lifting is more than just bodybuilding or gaining super strength.  It is also the healthiest and safest form of exercise that exists.
Weight lifting invigorates the body.  Healing hormones [...]]]></description>
			<content:encoded><![CDATA[<p>PART 1:</p>
<p>This program is the simplest and greatest weight lifting program for everyone.</p>
<p>But first..  Why weight lift?  Should everyone weight lift?</p>
<p>Absolutely!  Weight lifting is more than just bodybuilding or gaining super strength.  It is also the healthiest and safest form of exercise that exists.</p>
<p>Weight lifting invigorates the body.  Healing hormones start getting released and bring improvements to all the organs and immune system.  The hormones help repair insulin insensitivity, a key factor to excess fat storage and carbohydrate addiction (resulting in bingeing).  It also starts reversing the effects of aging as well as improving the density of bone, reducing osteoporosis risk.</p>
<p>Think about how great you will feel when you are strong.  You&#8217;ll be safer while playing or working.  Everything will feel lighter so you&#8217;ll be less tired from lifting or carrying anything.  If you run, you&#8217;ll be able to go faster.</p>
<p>Also, weight lifting is one of the safest form of exercise.  It has the lowest injury rates of all sports and exercise programs.  Done properly with good form and low amounts of repetitions between sets, it is incredibly safe.  </p>
<p>In fact, most injuries mainly come from high amounts of repetition.  For example, bodybuilders frequently do more than 10 repetitions per set.  The more repetitions done, the more tired out the body gets, and the easier it is to get distracted and lazy and exercise with poor form, which can cause pulled muscles.  Also doing lots of repetitions can result in repetitive strain that cause injury.</p>
<p>What sort of weight lifting program is good for everyone?</p>
<p>It should be extremely simple and take very little time to do.  It should be something that everyone can do.  It should also offer continuous improvement.</p>
<p>This exericse program I am going to tell you about offers that:</p>
<ul>
<li>It only needs <u>one</u> exercise: <b>The Lift</b></li>
<li>It only needs to be done once every 2 days (or 3 times a week)</li>
<li>It only needs 7 minutes per workout</li>
</ul>
<p><strong>The lift</strong> is the absolute best exercise for several reasons.</p>
<ul>
<li>It is a compound exercise</li>
<p>  Lifting involves the legs, back, abs, arms, and shoulders.  It hits all the muscles in the body.</p>
<li>It handles the heaviest weights</li>
<p> Of all the compound exercises, this exercise lets you handle the heaviest weight.  The effect of lifting the heaviest weights creates the biggest benefits for the body.  The sheer recruitment of all the muscles to handle the heaviest weight safely, causes the body to respond with the most growth hormones.</p>
<li>There are different ways to lift safely</li>
<p> There are several variations for lifting, which is useful because some lifts will be more suitable for our body.  The primary lift is known as the Deadlift, which is done with a big bar and some weights on each end.  This is one of the exercises that the olympic powerlifters do.  There are several different ways of doing the Deadlift, using different stances, depending on body type.  For example, a sumo-stance is often used by people with shorter legs and longer torsos.</p>
<p>  Another lift is known as the &#8216;Health Lift&#8217; which was popular in the 1800s.  It involves lifting weights starting at knee height, which is easier and safer than the Deadlift.</p>
<li>It can be done with simple equipment anywhere</li>
<p>  No need for a squat cage or a bench or any fancy equipment at all.  All you need are weights of differing poundages.  In practice, this might just be as simple as having a bar and some weights that you can add to the bar.
</ul>
<p>To Be Continued in Part 2</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesrobey.com/weight-lifting-for-everyone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Railsway &#8211; a TV Series idea</title>
		<link>http://www.jamesrobey.com/project-railsway-a-tv-series-idea/</link>
		<comments>http://www.jamesrobey.com/project-railsway-a-tv-series-idea/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 03:03:11 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://jamesrobey.com/?p=9</guid>
		<description><![CDATA[Tonight I was watching &#8220;Project Runaway&#8221; which is a television series that collects 12 aspiring clothing designers to compete in a series of challenges and the top 3 finalists get to show their collection of designs in front of fashion industry professionals at a fashion week event.  Each challenge has a time limit and [...]]]></description>
			<content:encoded><![CDATA[<p>Tonight I was watching &#8220;Project Runaway&#8221; which is a television series that collects 12 aspiring clothing designers to compete in a series of challenges and the top 3 finalists get to show their collection of designs in front of fashion industry professionals at a fashion week event.  Each challenge has a time limit and some are as short as 10 hours, some go to 18 hours or more.  </p>
<p>For some reason I find the show rather interesting to watch, I find it motivating to watch people with such obvious passion for their work and they are challenged to put all their skill and creativity into each challenge or risk not moving onto the next round.</p>
<p>There is another industry that I know of where many of the people in it are highly passionate, and that is Ruby on Rails web developers.  I think it would be entirely possible to do a show with a similar format to &#8220;Project Runaway&#8221; and pull it off.</p>
<p>I know, who wants to see programmers sitting in front of computers with lines of code on their monitor, how is that entertainment?  However, in &#8220;Project Runaway&#8221; they seldom show the actual details of making the clothing.  There are a lot of other things happening, most of the show is comprised of showing the background story, the interactions of the contenders with each other, interviewing them before the challenge, during the challenge, before judging, during judging, after judging, plus the judges and their responses, showing the clothing at various stages of being made, from collecting the fabric, stressing out during the alloted time, fitting the clothing to the models, getting advice from the group&#8217;s mentor and then the model walkout.  There is a lot involved to the television show without boring the viewers with the tedious details of the actual sewing and other design work.  </p>
<p>Because of that, I think that a Ruby on Rails design show would work very well.  Prototypes of the websites can be shown in the varying stages from the begining to finish.  Also, Ruby on Rails developers can build working webapps in as little as 10 hours.  </p>
<p>An added bonus is that there is quite a few Ruby on Rails developers that are photogenic.  Quite a few are the stereotypical artsy funky stylishly dressed mac users.  Not as many Ruby on Rails developers are fat or sloppy as you would expect.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesrobey.com/project-railsway-a-tv-series-idea/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Validates_uniqueness_of and single table inheritance</title>
		<link>http://www.jamesrobey.com/validates_uniqueness_of-and-single-table-inheritance/</link>
		<comments>http://www.jamesrobey.com/validates_uniqueness_of-and-single-table-inheritance/#comments</comments>
		<pubDate>Fri, 18 May 2007 22:58:27 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.jamesrobey.com/validates_uniqueness_of-and-single-table-inheritance/</guid>
		<description><![CDATA[If you&#8217;re using STI (single table inheritance) with some Ruby on Rails models, and you need to make sure some fields are unique across all the models, you can use validates_uniqueness_of in the parent model using the :scope option to apply it to all the models.  So in this instance since you have a [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using STI (single table inheritance) with some Ruby on Rails models, and you need to make sure some fields are unique across all the models, you can use validates_uniqueness_of in the parent model using the :scope option to apply it to all the models.  So in this instance since you have a type field in the table, you would use:</p>
<p><code><br />
validates_uniqueness_of :name, :scope => :type<br />
</code></p>
<p>However, you might encounter trouble with type being a deprecated method that is aliased to class.  The fix is to add this before the validation:</p>
<p><code><br />
undef_method :type<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesrobey.com/validates_uniqueness_of-and-single-table-inheritance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Rake tasks ignore Rails observers</title>
		<link>http://www.jamesrobey.com/making-rake-tasks-ignore-rails-observers/</link>
		<comments>http://www.jamesrobey.com/making-rake-tasks-ignore-rails-observers/#comments</comments>
		<pubDate>Wed, 16 May 2007 22:45:13 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://jamesrobey.com/making-rake-tasks-ignore-rails-observers/</guid>
		<description><![CDATA[Have you ever run &#8220;rake db:migrate&#8221; on an empty database (or you did &#8220;rake db:migrate VERSION=0&#8243; to empty the database).  And then it fails on you like this?

rake db:migrate
(in /Users/foucist/rails/myproject)
rake aborted!
Mysql::Error: #42S02Table 'myproject_development.users' doesn't exist: SHOW FIELDS FROM users
(See full trace by running task with --trace)

Invariably, rake failures are caused by something in the [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever run &#8220;rake db:migrate&#8221; on an empty database (or you did &#8220;rake db:migrate VERSION=0&#8243; to empty the database).  And then it fails on you like this?</p>
<p><code><br />
rake db:migrate<br />
(in /Users/foucist/rails/myproject)<br />
rake aborted!<br />
Mysql::Error: #42S02Table 'myproject_development.users' doesn't exist: SHOW FIELDS FROM users<br />
(See full trace by running task with --trace)<br />
</code></p>
<p>Invariably, rake failures are caused by something in the environment file that is expecting something in the database.  Sometimes people stick a .find() in the environment file unfortunately.  In this case, it turned out to be the user observer.</p>
<p><code><br />
Rails::Initializer.run do |config|<br />
  config.action_controller.session_store = :active_record_store<br />
  config.active_record.observers = :user_observer<br />
end<br />
</code></p>
<p>After examining the code for the rake tasks in /opt/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/tasks/ I noticed that the environment file was loaded with &#8216;require&#8217;.  That means that environment.rb is code (obviously) and now I can change the line for the user observer to not load when rake is loading it.</p>
<p><code><br />
config.active_record.observers = :user_observer unless File.basename( $0 ) == "rake"<br />
</code></p>
<p>Viola.  File.basename is just a trick to parse the $0 variable which is the name of the binary thats loading the file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesrobey.com/making-rake-tasks-ignore-rails-observers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.230 seconds -->
