<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>rails &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/rails/</link>
	<description>Feed of posts on WordPress.com tagged "rails"</description>
	<pubDate>Fri, 05 Sep 2008 16:07:46 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Rails agrega soporte para "shallow nested routes"]]></title>
<link>http://gastonramos.wordpress.com/?p=114</link>
<pubDate>Fri, 05 Sep 2008 15:06:17 +0000</pubDate>
<dc:creator>Gastón Ramos</dc:creator>
<guid>http://gastonramos.wordpress.com/?p=114</guid>
<description><![CDATA[Muchas veces cuando tenemos recursos anidados nos encontramos definiendo un map.resource (o una ruta]]></description>
<content:encoded><![CDATA[<p>Muchas veces cuando tenemos recursos anidados nos encontramos definiendo un map.resource (o una ruta) adicional para acceder al mismo recurso pero sin la anidación. Para referenciar a un miembro específico de este sin el prefijo del padre sin tener que definir otra ruta, Rails edge agrega una opción a map.resource para lograr esto.</p>
<p><strong>Ejemplo:</strong></p>
<pre>
map.resources :users, :shallow =&#62; true do &#124;user&#124;
  user.resources :posts
end
</pre>
<p>* GET /users/1/posts (mapea a la acción PostsController#index action como siempre)<br />
      se agrega la ruta nombrada "user_posts" como siempre.</p>
<p><strong>Lo nuevo:</strong></p>
<p>* GET /posts/2 (mapea a la acción PostsController#show como si no sería anidada)<br />
      Adicionalmente, se agrega también la ruta nombrada "post".</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Brazilian Rails no TreinaTom]]></title>
<link>http://tinogomes.wordpress.com/?p=139</link>
<pubDate>Fri, 05 Sep 2008 11:30:28 +0000</pubDate>
<dc:creator>Celestino Gomes</dc:creator>
<guid>http://tinogomes.wordpress.com/?p=139</guid>
<description><![CDATA[É gALLera, amanhã é dia de palestra no TreinaTom e adivinha que vai falar dessa vez? Isso mesmo, ]]></description>
<content:encoded><![CDATA[<p>É gALLera, amanhã é dia de palestra no <a title="Site do TreinaTom" href="http://www.treinatom.com.br/" target="_blank">TreinaTom</a> e adivinha que vai falar dessa vez? Isso mesmo, esse boça que vos escreve, então não perca. Vou demostrar algumas funcionalidades do nosso tão querido plugin, o <a href="http://www.improveit.com.br/software_livre/brazilian_rails" target="_blank">Brazilian Rails</a>, que agora, como a maioria já sabe, não é apenas plugin mas também é uma gem. Agora, podemos usar alguns dos recursos do Brazilian Rails em outros frameworks, como <a title="Merc" href="http://merbivore.com/" target="_blank">Merb</a>, <a title="Sinatra" href="http://rubyforge.org/projects/sinatra/" target="_blank">Sinatra</a>, <a title="Mack" href="http://www.mackframework.com/">Mack</a> e <a title="Ramaze" href="http://ramaze.net/" target="_blank">vários</a> <a title="Camping" href="http://camping.rubyforge.org/files/README.html" target="_blank">outros</a> <a title="Busca no Google por frameworks em Ruby" href="http://www.google.com/search?q=ruby+framework" target="_blank">que existem</a>, mas por que não Ruby puro? :)</p>
<p>Ah, quando vai ser mesmo? Sábado, dia 06/09/2008, às 15:00, no site <a href="http://www.treinatom.com.br/cafe-com-o-tom" target="_blank">http://www.treinatom.com.br/cafe-com-o-tom</a>.</p>
<p>Quanto custa? Seu tempo e paciência. :P</p>
<p>Espero por vocês!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Quick Hack: Cutting RSpec test time...]]></title>
<link>http://codehunk.wordpress.com/?p=58</link>
<pubDate>Fri, 05 Sep 2008 04:52:07 +0000</pubDate>
<dc:creator>janmejay</dc:creator>
<guid>http://codehunk.wordpress.com/?p=58</guid>
<description><![CDATA[I spent last couple hours trying to cut feedback time for the RSpec test suite for the Rails project]]></description>
<content:encoded><![CDATA[<p>I spent last couple hours trying to cut feedback time for the RSpec test suite for the Rails project that I work on....<br />
I did fairly general things... and managed to cut the feedback time to almost 40% (approximately from 174 seconds to 72 seconds, on a MacBook Pro-Intel). Which is quite significant....<br />
So, here are the two major things i did.... </p>
<p><strong>Nailing the worst few( -24 seconds out of 174 )</strong>:<br />
 I used <strong><em>spec ./spec -f profile</em></strong> to get me the 10 most time taking specs. And changed <em>before(:each) </em>to <em>before(:all). </em>In RSpec world, theoretically, each spec is supposed to validate one behavior. So specs on there own, were pretty lean, doing things like asserting sensible defaulting, correct options for SQL query, or verifying result of a query etc... The data setup was happening in the <em>before</em> block, and everyone was using the same data. Nested <em>describe(s)</em> were adding to the <em>before(s)</em>... <br />
On these low performing specs, <em>before(s)</em> were pretty bloated... so making them <em>before(:all)</em> reduced the execution time by <em>(before block time)*(number of specs)</em>.....<br />
 <strong>Practicality beats purity</strong>.... I should not have done this... but it gave me some 24 seconds of boost...(when done for 40 specs)... so i took it..... <strong>BUT it left the specs vulnerable to side effects(</strong>hence not infinitely scalable.... more you do it... lesser the benefit, and more the miseries.....<strong>)</strong>. I had to put some extra effort to fix the side effects caused by the same entities getting shared across multiple specs... Not the best solution in the galaxy.... but whatever works..... </p>
<p><strong>Parallelization..... The bad boy( -78 seconds out of 174 ):<br />
 </strong>The thought process behind this one was, that a lot of time is wasted on a synchronized process, when it gets IO bound. Writing to the db socket, reading from it... reading files...(ruby files, haml templates, spec files themselves... rails code-base files....) you name it... <br />
But wait... bringing <em>Ruby Threads</em> in, is gonna be N<strong>O</strong> better either.... because ruby doesn't have native threads...<br />
Old friend to rescue..... I used <strong>fork</strong>.... <br />
The app has specs segregated in sub-directories...(spec -&#62; controllers, spec -&#62; views, spec -&#62; models, spec -&#62; helpers, spec -&#62; lib) etc.... I spawned one process per sub-directory....<br />
I wrote this crude rake task(<a href="http://pastie.org/266452">http://pastie.org/266452</a>), which did the trick.... <br />
I defined more environments for each sub-spec set in the database.yml file... which had different database names(to avoid deadlocks @ the DB level)....  now the database.yml looks like this.... (<a href="http://pastie.org/266456">http://pastie.org/266456</a>)<br />
Thats it..... now i just run <strong>rake foo</strong>, which does the trick....<br />
Reporting is pretty insane... because it has to be inspected it visually.... but thats fairly ok... because we are planning to use this only for developers doing quick sanity check before pushing to the source control.... continuous integration box is still using the conventional single process thing(<strong>rake spec</strong>).<br />
Im sure reporting can be tweaked to figure out passing or failing of specs.... and then the parallelized version can be used on the continuous integration box as well...... Wether im gonna do it or not... depends on how much time i get tomorrow... ;-)</p>
<p>Hope this was useful......</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Sept. 19th: Ruby on Rails Project Night @ The Rich Media Institute]]></title>
<link>http://correlations.wordpress.com/?p=115</link>
<pubDate>Thu, 04 Sep 2008 14:05:30 +0000</pubDate>
<dc:creator>correlations</dc:creator>
<guid>http://correlations.wordpress.com/?p=115</guid>
<description><![CDATA[
Hello all Rubists!!!
After a much needed summer hiatus, the Ruby on Rails Project Night &#8216;comm]]></description>
<content:encoded><![CDATA[<p><a href="http://correlations.files.wordpress.com/2008/09/voice-oscillator.jpg"><img class="aligncenter size-full wp-image-116" src="http://correlations.wordpress.com/files/2008/09/voice-oscillator.jpg" alt="" width="504" height="360" /></a></p>
<p style="text-align:center;"><strong>Hello all Rubists!!!</strong></p>
<p>After a much needed summer hiatus, the Ruby on Rails Project Night 'community' is set to gather again on Friday September 19th at a NEW location: the <a title="Rich Media Institute" href="http://www.richmediainstitute.com/" target="_blank">Rich Media Institute</a>!</p>
<p>As some of you may realize, this is a new evening for us. I don't intend on having our get togethers on Friday, but September 19th is very special.</p>
<p>I am pleased to have <a title="James Robertson Bio" href="http://www.cincomsmalltalk.com/blog/blogView?content=bio" target="_blank">James Robertson</a>, Cincom Smalltalk Product Evangelist, joining us on his 'Canadian Tour' to look at Seaside and WebVelocity:</p>
<p><em>WebVeocity is a new Smalltalk Development Environment that is oriented around Seaside for Web Development and Glorp for Object/Relatonal Mapping. Come and see how WebVelocity re-targets the Smalltalk development experience into the Web Browser and simplifies the challenge of learning a new environment for newcomers. We'll even build an entire application using Active Record and Scaffolding during the presentation, with minimal programming. If you're a fan of Ruby on Rails, you need to come out and see this presentation!</em></p>
<p>We will also be joined by local Ruby on Rails developer <a title="Paul Doerwald's blog" href="http://pauldoerwald.ca/" target="_blank">Paul Doerwald</a>, who will examine insights gained from working with <em>A</em><em>ctiveRecord validation internals</em>.</p>
<p>As always, it is <strong>the audience</strong> - and their participation - that really makes these events great; so I hope you can all join us for this special opportunity. These <strong>FREE</strong> presentations will take place on September 19th starting at 6pm until approx 7:30pm at the Rich Media Institute.</p>
<p>Please email me at <span style="color:#0000ff;">corecorina@hotmail.com</span> or leave a comment below if you are attending - space is limited, please RSVP!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Saudades do TextMate - Deixando o gedit com cara do textmate]]></title>
<link>http://mgzmaster.wordpress.com/?p=54</link>
<pubDate>Wed, 03 Sep 2008 20:22:08 +0000</pubDate>
<dc:creator>telltarget</dc:creator>
<guid>http://mgzmaster.wordpress.com/?p=54</guid>
<description><![CDATA[Eu estava utilizando como Sistema Operacional o MAC OS versão 10.5.3. Mas como tenho um PC.. foi ne]]></description>
<content:encoded><![CDATA[<p>Eu estava utilizando como Sistema Operacional o MAC OS versão 10.5.3. Mas como tenho um PC.. foi necessário utilizar a versão modificadas.. batizada de OS/X86.</p>
<p>Recomendo para quem tem interesse de conhecer esse magnifico S.O., mas não recomendo se você pretende ter estabilidade.</p>
<p>Após ocorrer alguns problemas.. e algumas reinstalações.. voltei para o meu querido Debian.</p>
<p>Mas como fazer para programar rails sem o TextMate? vamos adaptar o Gedit para ficar com a aparência o mais próximo possível com o TextMate.</p>
<p>Aqui vai algumas dicas simples:</p>
<p>para instalar é o de sempre</p>
<p>#apt-get install gedit</p>
<p>Digite gedit no console para abrir o programa.</p>
<p>Clique em editar -&#62; preferências:</p>
<p>Na aba "Visualização" marque</p>
<p>(X) Habilitar quebra de texto;<br />
(X) Não dividir uma palavra em duas linhas;<br />
(X) Mostrar números de linha;<br />
(X) Destacar linha atual;<br />
(X) Destacar parênteses correspondentes;</p>
<p>Na aba "Editor" marque:</p>
<p>Largura das tabulações = 2</p>
<p>(X) Habilitar recuo automático;<br />
(X) Criar uma cópia de backup dos arquivos antes de salvar;<br />
(X) Salvar arquivos automaticamente a cadas 5 minutos;</p>
<p>Na aba "Fontes e Cores"</p>
<p>Em esquema de Cores recomendo o tema Clássico ou o Oblivion <span style="text-decoration:line-through;">(Na minha opinião Oblivion é melhor :D )</span>, mas isso vai da preferência de cada um.<span style="text-decoration:line-through;"><br />
</span></p>
<p>Na aba "Plug-ins" marque:</p>
<p>(X) Estatísticas do Documento;<br />
(X) Inserir Data/Hora;<br />
(X) Modelines;<br />
(X) Painel de Navegador de Arquivos;<br />
(X) Trechos;<br />
(X) Verificador Ortográfico;</p>
<p>Para exibir o painel lateral basta pressionar F9.</p>
<p>No painel lateral não utilize "Documentos" e sim "Navegador de arquivos"</p>
<p>Créditos do artigo: <a title="Marcos Miras" href="http://www.vivaolinux.com.br/dica/Deixando-seu-GEdit-com-a-cara-do-TextMate" target="_self">Marcos Miras</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Set an id by force on a ActiveRecord model]]></title>
<link>http://qzio.wordpress.com/?p=8</link>
<pubDate>Wed, 03 Sep 2008 17:20:20 +0000</pubDate>
<dc:creator>qzio</dc:creator>
<guid>http://qzio.wordpress.com/?p=8</guid>
<description><![CDATA[ok, I cant se why this is behaving like it does&#8230; I have
## ProductGroup have this:

class Prod]]></description>
<content:encoded><![CDATA[<p>ok, I cant se why this is behaving like it does... I have</p>
<p>## ProductGroup have this:<br />
<code><br />
class ProductGroup &#60; ActiveRecord::Base<br />
  set_primary_key "id"<br />
  has_and_belongs_to_many :products<br />
  validates_uniqueness_of :id<br />
  def self.gen_new_id() # {{{<br />
    counter = 1001<br />
    groups = ProductGroup.find :all<br />
    if groups.nil? &#124;&#124; groups.empty?<br />
      return counter<br />
    end</p>
<p>    all_ids = groups.collect{&#124;g&#124; g.id}<br />
    unless all_ids.nil?<br />
      while all_ids.include?(counter)<br />
        counter = counter+1<br />
      end<br />
    end<br />
    return counter<br />
  end # }}}<br />
  ...<br />
</code><br />
## migration:<br />
<code><br />
    create_table :product_groups, :id =&#62; false do &#124;t&#124;<br />
      t.integer :id, :nil =&#62; false, :key =&#62; true<br />
      t.string :name<br />
      t.string :identifier<br />
      t.string :type_is<br />
      t.timestamps<br />
    end<br />
</code></p>
<p>doing rake db:drop:all &#38;&#38; rake db:create:all &#38;&#38; rake db:migrate. then jumping into ./script/console</p>
<p><code><br />
Loading development environment (Rails 2.1.0)<br />
&#62;&#62; f = ProductGroup.find_or_create_by_identifier('first')<br />
=&#62; #<br />
&#62;&#62; f.id = ProductGroup.gen_new_id<br />
=&#62; 1001<br />
&#62;&#62; f.save<br />
=&#62; true<br />
&#62;&#62; f.id<br />
=&#62; 1001<br />
&#62;&#62; ProductGroup.find :all<br />
=&#62; [#]<br />
&#62;&#62; s = ProductGroup.find_or_create_by_identifier('second')<br />
=&#62; #<br />
&#62;&#62; s.id = ProductGroup.gen_new_id<br />
=&#62; 1001<br />
&#62;&#62; s.save<br />
=&#62; true<br />
&#62;&#62; s.id<br />
=&#62; 1001<br />
&#62;&#62; ProductGroup.find(:all).collect{&#124;g&#124; "#{g.identifier} has id:(#{g.id})" }<br />
=&#62; ["first has id:()", "second has id:(1001)"]<br />
&#62;&#62; ProductGroup.destroy_all<br />
=&#62; [#, #]<br />
&#62;&#62; ProductGroup.find :all<br />
=&#62; [#]<br />
&#62;&#62; ProductGroup.delete_all<br />
=&#62; 1<br />
&#62;&#62; </p>
<p></code></p>
]]></content:encoded>
</item>

</channel>
</rss>
