<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Plataformatec Blog » English</title>
	
	<link>http://blog.plataformatec.com.br</link>
	<description>Plataformatec's place to talk about Ruby, Ruby on Rails and software engineering</description>
	<lastBuildDate>Fri, 10 May 2013 20:36:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/PlataformaBlog_english" /><feedburner:info uri="plataformablog_english" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Devise and Rails 4</title>
		<link>http://feedproxy.google.com/~r/PlataformaBlog_english/~3/P9u-fjG_09M/</link>
		<comments>http://blog.plataformatec.com.br/2013/05/devise-and-rails-4/#comments</comments>
		<pubDate>Fri, 10 May 2013 20:36:15 +0000</pubDate>
		<dc:creator>Carlos Antônio</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[devise]]></category>
		<category><![CDATA[mail_form]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[rails 4]]></category>
		<category><![CDATA[responders]]></category>
		<category><![CDATA[show_for]]></category>
		<category><![CDATA[simple_form]]></category>

		<guid isPermaLink="false">http://blog.plataformatec.com.br/?p=3440</guid>
		<description><![CDATA[Devise 3.0 rc version with Rails 4 compatibility and new 2.2.4 stable version. Simple Form, Responders, Show For and Mail Form versions with Rails 4 compatibility.]]></description>
				<content:encoded><![CDATA[<p>This week we released the first release candidate version of Devise that is fully compatible with Rails 4, and we&#8217;re bumping its version to 3.0. This version completely drops support for Rails 3.1 and Ruby 1.8.7, only keeping compatibility with both Rails 3.2 and Rails 4, running with Ruby 1.9.3 and 2.0.</p>
<p>This rc version took some time to get ready, we&#8217;ve been running a <em>rails4</em> branch for some time already and one of the reasons was because of the changes required to <a href="https://github.com/plataformatec/devise/commit/c63483ae2409ba44889756796930f5d45630d7b3">make it compatible with the new <strong>strong parameters</strong> API from Rails 4</a>. We are aware that some people have been using this branch since Rails 4.0 beta1 with success, and we&#8217;re now inviting you to try 3.0 rc with the <a href="http://weblog.rubyonrails.org/2013/5/1/Rails-4-0-release-candidate-1/">recent release of Rails 4.0 rc1</a>.</p>
<h3>Devise stable</h3>
<p>Together with the 3.0 beta version, we&#8217;ve released Devise 2.2.4 with a few enhancements and bug fixes, make sure to <a href="https://github.com/plataformatec/devise/blob/v2.2.4/CHANGELOG.rdoc">check the changelog</a> to see the new goodies. All changes are also included in the rc version.</p>
<h3>Simple Form</h3>
<p>Simple Form has been running a 3.0 rc version for a couple months already, fully compatible with Rails 4 as well, and today we are releasing its release candidate version. In Simple Form master we just dropped support to the 3.x Rails series, focusing our work on Rails 4 compatibility from now on, due to a series of improvements in Rails 4 regarding form helpers &#8211; but don&#8217;t worry, we will be keeping a v2.1 branch with Rails 3.2 compatibility for a while.</p>
<p>We have some cool plans to improve the wrappers API even further, but that&#8217;s subject for another blog post <img src='http://blog.plataformatec.com.br/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<h3>Responders</h3>
<p>Responders has been around for quite some time already and we use it in most of our projects, so today we&#8217;re celebrating its 1.0 release candidate version, specially to support Rails 4.</p>
<h3>Show For</h3>
<p>Show For just got a new stable release, v0.2.6, with all the enhancements and bug fixes that were in master, plus a v0.3.0 rc version that adds Rails 4 support.</p>
<h3>Mail Form</h3>
<p>Mail Form also got a new 1.5 rc release with Rails 4.0 compatibility. Nothing else has changed from the current 1.4 version.</p>
<h3>Has Scope</h3>
<p>Has Scope is getting a new 0.6 rc version with Rails 4.0 compatibility, including a couple of fixes that were already present in master.</p>
<h2>Compatibility</h2>
<p>All these new releases are officially dropping support to Rails 3.0 and 3.1, and Ruby 1.8.7. We&#8217;ll keep compatibility with Rails 3.2 and 4.0 from now on, all of them on the same branches except for Simple Form which has different branches for each Rails version.</p>
<h2>Wrapping up</h2>
<p>We&#8217;ve got new hot releases for you to try out with Rails 4, please give them a try and let us know if you find any issue or have any feedback.</p>
<p>We&#8217;d also like to specially thank everyone involved in helping us getting these projects up and running in Rails 4, without you folks that&#8217;d have never been possible.</p>
<p>Enjoy &lt;3</p>
<img src="http://feeds.feedburner.com/~r/PlataformaBlog_english/~4/P9u-fjG_09M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.plataformatec.com.br/2013/05/devise-and-rails-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.plataformatec.com.br/2013/05/devise-and-rails-4/</feedburner:origLink></item>
		<item>
		<title>Take a look at Simple Form and Devise brand new logos</title>
		<link>http://feedproxy.google.com/~r/PlataformaBlog_english/~3/SrskbHW6CAo/</link>
		<comments>http://blog.plataformatec.com.br/2013/02/take-a-look-at-simple-form-and-devise-brand-new-logos/#comments</comments>
		<pubDate>Tue, 26 Feb 2013 21:23:48 +0000</pubDate>
		<dc:creator>José Valim</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[devise]]></category>
		<category><![CDATA[logos]]></category>
		<category><![CDATA[simple form]]></category>

		<guid isPermaLink="false">http://blog.plataformatec.com.br/?p=3422</guid>
		<description><![CDATA[We are very glad to announce the logos for two of our favorite Rails open source projects&#8230; Simple Form: And Devise: We would like to congratulate our designer, Bruna Kochi, who was able to capture the essence of each project in their logos. We will write about their design process soon! Those projects have been [...]]]></description>
				<content:encoded><![CDATA[<p>We are very glad to announce the logos for two of our favorite Rails open source projects&#8230;</p>
<p><a href="https://github.com/plataformatec/simple_form">Simple Form</a>:</p>
<div style="margin: 20px auto; text-align: center;">
   <img src="https://raw.github.com/plataformatec/simple_form/master/simple_form.png" alt="Simple Form Logo">
</div>
<p>And <a href="https://github.com/plataformatec/devise">Devise</a>:</p>
<div style="margin: 20px auto; text-align: center;">
   <img src="https://raw.github.com/plataformatec/devise/master/devise.png" alt="Devise Logo">
</div>
<p>We would like to congratulate our designer, <a href="https://twitter.com/brutiko">Bruna Kochi</a>, who was able to capture the essence of each project in their logos. We will write about their design process soon!</p>
<p>Those projects have been in the Rails community for almost 4 years and it was about time for them to have their own visual identity! We would like to thank all contributors and users who have helped those projects to be more robust, flexible and popular!</p>
<img src="http://feeds.feedburner.com/~r/PlataformaBlog_english/~4/SrskbHW6CAo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.plataformatec.com.br/2013/02/take-a-look-at-simple-form-and-devise-brand-new-logos/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.plataformatec.com.br/2013/02/take-a-look-at-simple-form-and-devise-brand-new-logos/</feedburner:origLink></item>
		<item>
		<title>Extending and customizing 3rd party code</title>
		<link>http://feedproxy.google.com/~r/PlataformaBlog_english/~3/3tEQYqerVws/</link>
		<comments>http://blog.plataformatec.com.br/2013/02/extending-customizing-3rd-party-code/#comments</comments>
		<pubDate>Mon, 25 Feb 2013 16:37:46 +0000</pubDate>
		<dc:creator>Lucas Mazza</dc:creator>
				<category><![CDATA[English]]></category>

		<guid isPermaLink="false">http://blog.plataformatec.com.br/?p=3390</guid>
		<description><![CDATA[We have a gem available for every kind of feature or scenario we might face in our applications and that may help us focus our development time on things that are more important to our applications. But, every now and then, these packaged solutions aren&#8217;t exactly what we need, and some sort of customization needs [...]]]></description>
				<content:encoded><![CDATA[<p>We have a gem available for every kind of feature or scenario we might face in our applications and that may help us focus our development time on things that are more important to our applications. But, every now and then, these packaged solutions aren&#8217;t exactly what we need, and some sort of customization needs to be done on top of that &#8211; a different authentication strategy, new ways to query for data and several different things that our business rules might require.</p>
<p>So, we jump on top of the existing code to bend it to our needs but sometimes things can go south and we end up in a mess of hacks, unstable code and bad experiences. After some time, we started to develop a few guidelines of our own to avoid the mistakes of the past and look forward to write better applications. These are some of the ideas that I follow to avoid complications when dealing with 3rd party code:</p>
<h2>Don&#8217;t fear the source</h2>
<p>The source code and its documentation are your best friends on this. Having a local clone of a dependency repository lets you <code>ack</code>/<code>grep</code> it inside out to see how the code is structured to identify the good and bad parts to mess with. You can test your changes against its test suite to see if you might break something or not and that&#8217;s already one step closer to contribute back to the project.</p>
<h2>Respect method visibility</h2>
<p>Method visibility is an important tool to ensure that you aren&#8217;t messing with the wrong pieces of code from a gem. Public and protected methods are meant to be overriden when necessary, but private ones aren&#8217;t. They are usually doing the work that you don&#8217;t want the trouble to do it yourself, and maybe that&#8217;s why you are using the dependency after all.</p>
<p>For example, <code>ActiveRecord</code> adds a lot of private methods to handle the persistence of your models that you shouldn&#8217;t mess with, but the public API is stable enough for you to use it for whatever you need.</p>
<h2>Monkey patch at your own peril</h2>
<p>Ruby lets you monkey patch everything but that doesn&#8217;t mean you should. While this might make a lot of sense for libraries that extend the Ruby stdlib (like <code>ActiveSupport</code>), monkey patching someone else constant might bite you back later. Overusing monkey patches might be a serious block when updating your application to newer versions of a big dependency of your project (for example, Rails).</p>
<p>When you monkey patch, you are usually messing with a very internal piece of a component that might be far from it&#8217;s public API. So, you can&#8217;t predict how that class or module will behave when a new version is released or what other parts of the code are using that internal API. Classes get renamed and refactored everyday, and it&#8217;s hard to ensure your patches will keep up with those changes.</p>
<h2>Composition (and inheritance) as extension mechanisms</h2>
<p>A lot of gems provide a series of configuration options that you can drop in an initializer and get the behavior you need, or maybe a specific configuration might be missing. You might feel the urge to send a pull request adding a new configuration to the project, but hold that idea for a second. Can&#8217;t you do it by overriding a method or using a custom component of your own?</p>
<p>Inheritance and composition can be a better choice for a lot of customizations since they are easier to test and to isolate the effects on your application. While a configuration setting is global and affects your entire application, an isolated change will have a much smaller impact on your code.</p>
<p>Take for instance the <code>to_param</code> and <code>to_partial_path</code> methods from <code>ActiveModel</code>. You can override them in your models to change how your views will interact with them, and that goes in a per model basis, since you usually won&#8217;t do that for your entire application. Imagine if you need to change a configuration instead overriding a method: You would have to do something weird like this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># A regular configuration inside an initializer</span>
config.<span style="color:#9900CC;">action_view</span>.<span style="color:#9900CC;">parameterize_method</span> = <span style="color:#ff3333; font-weight:bold;">:slug</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># But what if I need a per model configuration? Well, use a Hash!</span>
config.<span style="color:#9900CC;">action_view</span>.<span style="color:#9900CC;">parameterize_methods</span> = <span style="color:#006600; font-weight:bold;">&#123;</span> post: <span style="color:#ff3333; font-weight:bold;">:slug</span>, user: <span style="color:#ff3333; font-weight:bold;">:id</span> <span style="color:#006600; font-weight:bold;">&#125;</span></pre></td></tr></table></div>

<p>While just overriding the <code>to_param</code> method in your <code>Post</code> model is a lot easier than this.</p>
<p>Another example of composition I came across recently was the <code>tokenizer</code> option on the <code>LengthValidator</code>. Given that you have a description column in your database that accepts HTML tags like <code>strong</code> and <code>em</code>, and you want to validate the length of the text, but not the HTML, you can provide an object that responds to <code>call</code> and strips away the HTML from the string, so the validation will be executed against the raw text instead of the whole HTML of it.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> MyOwnTokenizer
  <span style="color:#9966CC; font-weight:bold;">def</span> call<span style="color:#006600; font-weight:bold;">&#40;</span>text<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#008000; font-style:italic;"># do whatever you need with `text`.</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># on your model…</span>
validates <span style="color:#ff3333; font-weight:bold;">:description</span>, <span style="color:#ff3333; font-weight:bold;">:length</span> <span style="color:#006600; font-weight:bold;">&#123;</span> tokenizer: MyOwnTokenizer.<span style="color:#9900CC;">new</span> <span style="color:#006600; font-weight:bold;">&#125;</span></pre></td></tr></table></div>

<h2>Your code, your problem</h2>
<p>Remember to test your changes. Once you change a default behavior or tweak some specific configuration that might have side effects on other parts of your application, your test coverage will help ensure that this behavior won&#8217;t break once you update a dependency on your project.</p>
<p>You usually shouldn&#8217;t worry about testing library defaults (like testing the validations on your models that you configured with <code>ActiveModel</code> validation methods), but once you customize something, that piece of code is your responsibility.</p>
<p>So, if you added your own <code>tokenizer</code> use along with a <code>LengthValidator</code> on your application, be sure to write at least an unit test for it to ensure that it works as expected.</p>
<h2>Contribute back</h2>
<p>Sometimes you might notice (or need) an improvement to a library that won&#8217;t change anything on its public API but will make your life easier when extending it. You can&#8217;t expect that the maintainers will discover every spot that can or might be overriden, so it&#8217;s important to bring your experience on using it to the table and help others. You can extract a specific behavior to an isolated component, or improve some internal logic so it might be easier to extend it in the future. There&#8217;s nothing but love for such kind of contribution.</p>
<p>A while ago <a href="https://github.com/rails/rails/pull/3636">this pull request</a> changed how Rails added the associations proxies to a model that is using <code>belongs_to</code> and friends. While it didn&#8217;t changes a single bit about the public API for the associations, it changed how you can extend them to add your specific behavior.</p>
<h2>Wrapping Up</h2>
<p>These steps might not fit everyone’s workflow, but we need to keep in mind that dealing with external dependencies requires a thoughtful approach to avoid the results being harmful to your projects.</p>
<p>And what about you, my fellow developer: how do you approach the need for something more than a gem&#8217;s default behavior? Jump on our comments thread to discuss more about it.</p>
<img src="http://feeds.feedburner.com/~r/PlataformaBlog_english/~4/3tEQYqerVws" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.plataformatec.com.br/2013/02/extending-customizing-3rd-party-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.plataformatec.com.br/2013/02/extending-customizing-3rd-party-code/</feedburner:origLink></item>
		<item>
		<title>Active Record scopes vs class methods</title>
		<link>http://feedproxy.google.com/~r/PlataformaBlog_english/~3/k3qzBuLQD-A/</link>
		<comments>http://blog.plataformatec.com.br/2013/02/active-record-scopes-vs-class-methods/#comments</comments>
		<pubDate>Thu, 07 Feb 2013 17:51:06 +0000</pubDate>
		<dc:creator>Carlos Antônio</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[activerecord]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails 3.2]]></category>
		<category><![CDATA[rails 4]]></category>
		<category><![CDATA[scopes]]></category>

		<guid isPermaLink="false">http://blog.plataformatec.com.br/?p=3354</guid>
		<description><![CDATA[One of the recent topics in our discussions at Plataformatec was about whether we should use scopes or class methods throughout the project to be consistent. It's also not hard to find discussions about it all over the internet. This is an attempt to show the differences between scopes and class methods, to help you understanding what scopes can give you for free and deciding what makes you feel more comfortable when writing your code.]]></description>
				<content:encoded><![CDATA[<p>Here at Plataformatec we use Github Pull Requests a lot for code review and this usually yields tons of constructive comments and excellent discussions from time to time. One of the recent topics was about whether we should use scopes or class methods throughout the project to be consistent. It&#8217;s also not hard to <a href="http://lmgtfy.com/?q=rails+%2B+scope+vs+class+method">find discussions about it all over the internet</a>. The classic comment usually boils down to <em>&#8220;there is no difference between them&#8221;</em> or <em>&#8220;it is a matter of taste&#8221;</em>. I tend to agree with both sentences, but I&#8217;d like to show some slight differences that exist between both.</p>
<h2>Defining a scope</h2>
<p>First of all, lets get a better understanding about how scopes are used. In Rails 3 you can define a scope in two ways:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> Post <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  scope <span style="color:#ff3333; font-weight:bold;">:published</span>, where<span style="color:#006600; font-weight:bold;">&#40;</span>status: <span style="color:#996600;">'published'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  scope <span style="color:#ff3333; font-weight:bold;">:draft</span>, <span style="color:#006600; font-weight:bold;">-&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> where<span style="color:#006600; font-weight:bold;">&#40;</span>status: <span style="color:#996600;">'draft'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span> 
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>The main difference between both usages is that the <code>:published</code> condition is evaluated when the class is first loaded, whereas the <code>:draft</code> one is lazy evaluated when it is called. Because of that, in Rails 4 the first way is going to be deprecated which means you will always need to declare scopes with a callable object as argument. This is to avoid issues when trying to declare a scope with some sort of Time argument:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> Post <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  scope <span style="color:#ff3333; font-weight:bold;">:published_last_week</span>, where<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'published_at &gt;= ?'</span>, <span style="color:#006666;">1</span>.<span style="color:#9900CC;">week</span>.<span style="color:#9900CC;">ago</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Because this won&#8217;t work as expected: <code>1.week.ago</code> will be evaluated when the class is loaded, not every time the scope is called.</p>
<h2>Scopes are just class methods</h2>
<p>Internally Active Record converts a scope into a class method. Conceptually, its simplified implementation in Rails master looks something like this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">scope</span><span style="color:#006600; font-weight:bold;">&#40;</span>name, body<span style="color:#006600; font-weight:bold;">&#41;</span>
  singleton_class.<span style="color:#9900CC;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:define_method</span>, name, <span style="color:#006600; font-weight:bold;">&amp;</span>body<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Which ends up as a class method with the given name and body, like this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">published</span>
  where<span style="color:#006600; font-weight:bold;">&#40;</span>status: <span style="color:#996600;">'published'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>And I think that&#8217;s why most people think: <em>&#8220;Why should I use a scope if it is just syntax sugar for a class method?&#8221;</em>. So here are some interesting examples for you to think about.</p>
<h2>Scopes are always chainable</h2>
<p>Lets use the following scenario: users will be able to filter posts by statuses, ordering by most recent updated ones. Simple enough, lets write scopes for that:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> Post <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  scope <span style="color:#ff3333; font-weight:bold;">:by_status</span>, <span style="color:#006600; font-weight:bold;">-&gt;</span> status <span style="color:#006600; font-weight:bold;">&#123;</span> where<span style="color:#006600; font-weight:bold;">&#40;</span>status: status<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
  scope <span style="color:#ff3333; font-weight:bold;">:recent</span>, <span style="color:#006600; font-weight:bold;">-&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> order<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;posts.updated_at DESC&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>And we can call them freely like this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">Post.<span style="color:#9900CC;">by_status</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'published'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">recent</span>
<span style="color:#008000; font-style:italic;"># SELECT &quot;posts&quot;.* FROM &quot;posts&quot; WHERE &quot;posts&quot;.&quot;status&quot; = 'published' </span>
<span style="color:#008000; font-style:italic;">#   ORDER BY posts.updated_at DESC</span></pre></td></tr></table></div>

<p>Or with a user provided param:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">Post.<span style="color:#9900CC;">by_status</span><span style="color:#006600; font-weight:bold;">&#40;</span>params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:status</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">recent</span>
<span style="color:#008000; font-style:italic;"># SELECT &quot;posts&quot;.* FROM &quot;posts&quot; WHERE &quot;posts&quot;.&quot;status&quot; = 'published' </span>
<span style="color:#008000; font-style:italic;">#   ORDER BY posts.updated_at DESC</span></pre></td></tr></table></div>

<p>So far, so good. Now lets move them to class methods, just for the sake of comparing:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> Post <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">by_status</span><span style="color:#006600; font-weight:bold;">&#40;</span>status<span style="color:#006600; font-weight:bold;">&#41;</span>
    where<span style="color:#006600; font-weight:bold;">&#40;</span>status: status<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">recent</span>
    order<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;posts.updated_at DESC&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Besides using a few extra lines, no big improvements. But now what happens if the <code>:status</code> parameter is <code>nil</code> or <code>blank</code>?</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">Post.<span style="color:#9900CC;">by_status</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">nil</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">recent</span>
<span style="color:#008000; font-style:italic;"># SELECT &quot;posts&quot;.* FROM &quot;posts&quot; WHERE &quot;posts&quot;.&quot;status&quot; IS NULL </span>
<span style="color:#008000; font-style:italic;">#   ORDER BY posts.updated_at DESC</span>
&nbsp;
Post.<span style="color:#9900CC;">by_status</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">recent</span>
<span style="color:#008000; font-style:italic;"># SELECT &quot;posts&quot;.* FROM &quot;posts&quot; WHERE &quot;posts&quot;.&quot;status&quot; = '' </span>
<span style="color:#008000; font-style:italic;">#   ORDER BY posts.updated_at DESC</span></pre></td></tr></table></div>

<p>Oooops, I don&#8217;t think we wanted to allow these queries, did we? With scopes, we can easily fix that by adding a presence condition to our scope:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">scope <span style="color:#ff3333; font-weight:bold;">:by_status</span>, <span style="color:#006600; font-weight:bold;">-&gt;</span> status <span style="color:#006600; font-weight:bold;">&#123;</span> where<span style="color:#006600; font-weight:bold;">&#40;</span>status: status<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> status.<span style="color:#9900CC;">present</span>? <span style="color:#006600; font-weight:bold;">&#125;</span></pre></td></tr></table></div>

<p>There we go:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">Post.<span style="color:#9900CC;">by_status</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">nil</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">recent</span>
<span style="color:#008000; font-style:italic;"># SELECT &quot;posts&quot;.* FROM &quot;posts&quot; ORDER BY posts.updated_at DESC</span>
&nbsp;
Post.<span style="color:#9900CC;">by_status</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">recent</span>
<span style="color:#008000; font-style:italic;"># SELECT &quot;posts&quot;.* FROM &quot;posts&quot; ORDER BY posts.updated_at DESC</span></pre></td></tr></table></div>

<p>Awesome. Now lets try to do the same with our beloved class method:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> Post <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">by_status</span><span style="color:#006600; font-weight:bold;">&#40;</span>status<span style="color:#006600; font-weight:bold;">&#41;</span>
    where<span style="color:#006600; font-weight:bold;">&#40;</span>status: status<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> status.<span style="color:#9900CC;">present</span>?
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Running this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">Post.<span style="color:#9900CC;">by_status</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">recent</span>
<span style="color:#CC00FF; font-weight:bold;">NoMethodError</span>: undefined method <span style="color:#996600;">`recent' for nil:NilClass</span></pre></td></tr></table></div>

<p>And :bomb:. The difference is that a scope will always return a relation, whereas our simple class method implementation will not. The class method should look like this instead:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">by_status</span><span style="color:#006600; font-weight:bold;">&#40;</span>status<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">if</span> status.<span style="color:#9900CC;">present</span>?
    where<span style="color:#006600; font-weight:bold;">&#40;</span>status: status<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">else</span>
    all
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Notice that I&#8217;m returning <code>all</code> for the <code>nil/blank</code> case, which in Rails 4 returns a relation (it previously returned the Array of items from the database). In Rails 3.2.x, you should use <code>scoped</code> there instead. And there we go:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">Post.<span style="color:#9900CC;">by_status</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">recent</span>
<span style="color:#008000; font-style:italic;"># SELECT &quot;posts&quot;.* FROM &quot;posts&quot; ORDER BY posts.updated_at DESC</span></pre></td></tr></table></div>

<p>So the advice here is: never return <code>nil</code> from a class method that should work like a scope, otherwise you&#8217;re breaking the chainability condition implied by scopes, that always return a relation.</p>
<h2>Scopes are extensible</h2>
<p>Lets get pagination as our next example and I&#8217;m going to use the <a href="https://github.com/amatsuda/kaminari">kaminari</a> gem as basis. The most important thing you need to do when paginating a collection is to tell which page you want to fetch:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">Post.<span style="color:#9900CC;">page</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></td></tr></table></div>

<p>After doing that you might want to say how many records per page you want:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">Post.<span style="color:#9900CC;">page</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">per</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">15</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></td></tr></table></div>

<p>And you may to know the total number of pages, or whether you are in the first or last page:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">posts = Post.<span style="color:#9900CC;">page</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span>
posts.<span style="color:#9900CC;">total_pages</span> <span style="color:#008000; font-style:italic;"># =&gt; 2</span>
posts.<span style="color:#9900CC;">first_page</span>? <span style="color:#008000; font-style:italic;"># =&gt; false</span>
posts.<span style="color:#9900CC;">last_page</span>?  <span style="color:#008000; font-style:italic;"># =&gt; true</span></pre></td></tr></table></div>

<p>This all makes sense when we call things in this order, but it doesn&#8217;t make any sense to call these methods in a collection that is not paginated, does it? When you write scopes, you can add specific extensions that will only be available in your object if that scope is called. In case of kaminari, it only adds the <code>page</code> scope to your Active Record models, and <a href="https://github.com/amatsuda/kaminari/blob/v0.14.1/lib/kaminari/models/active_record_model_extension.rb#L12-L17">relies on the scope extensions feature to add all other functionality when <code>page</code> is called</a>. Conceptually, the code would look like this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">scope <span style="color:#ff3333; font-weight:bold;">:page</span>, <span style="color:#006600; font-weight:bold;">-&gt;</span> num <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#008000; font-style:italic;"># some limit + offset logic here for pagination } do</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> per<span style="color:#006600; font-weight:bold;">&#40;</span>num<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#008000; font-style:italic;"># more logic here</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> total_pages
    <span style="color:#008000; font-style:italic;"># some more here</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> first_page?
    <span style="color:#008000; font-style:italic;"># and a bit more</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> last_page?
    <span style="color:#008000; font-style:italic;"># and so on</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Scope extensions is a powerful and flexible technique to have in our toolchain. But of course, we can always go wild and get all that with class methods too:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">page</span><span style="color:#006600; font-weight:bold;">&#40;</span>num<span style="color:#006600; font-weight:bold;">&#41;</span>
  scope = <span style="color:#008000; font-style:italic;"># some limit + offset logic here for pagination</span>
  scope.<span style="color:#9900CC;">extend</span> PaginationExtensions
  scope
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">module</span> PaginationExtensions
  <span style="color:#9966CC; font-weight:bold;">def</span> per<span style="color:#006600; font-weight:bold;">&#40;</span>num<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#008000; font-style:italic;"># more logic here</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> total_pages
    <span style="color:#008000; font-style:italic;"># some more here</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> first_page?
    <span style="color:#008000; font-style:italic;"># and a bit more</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> last_page?
    <span style="color:#008000; font-style:italic;"># and so on</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>It is a bit more verbose than using a scope, but it yields the same results. And the advice here is: pick what works better for you but make sure you know what the framework provides before reinventing the wheel.</p>
<h2>Wrapping up</h2>
<p>I personally tend to use scopes when the logic is very small, for simple where/order clauses, and class methods when it involves a bit more complexity, but whether it receives an argument or not doesn&#8217;t really matter much to me. I also tend to rely more on scopes when doing extensions like showed here, since it&#8217;s a feature that Active Record already gives us for free.</p>
<p>I think it&#8217;s important to clarify the main differences between scopes and class methods, so that you can pick the <em>right tool for the job</em>™, or the tool that makes you more <em>comfortable</em>. Whether you use one or another, I don&#8217;t think it really matters, as long as you write them clear and consistently throughout your application.</p>
<p>Do you have any thought about using scopes vs class methods? Make sure to leave a comment below telling us what you think, we&#8217;d love to hear.</p>
<img src="http://feeds.feedburner.com/~r/PlataformaBlog_english/~4/k3qzBuLQD-A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.plataformatec.com.br/2013/02/active-record-scopes-vs-class-methods/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		<feedburner:origLink>http://blog.plataformatec.com.br/2013/02/active-record-scopes-vs-class-methods/</feedburner:origLink></item>
		<item>
		<title>Security announcement: Devise v2.2.3, v2.1.3, v2.0.5 and v1.5.4 released</title>
		<link>http://feedproxy.google.com/~r/PlataformaBlog_english/~3/AYW9MfHpsgc/</link>
		<comments>http://blog.plataformatec.com.br/2013/01/security-announcement-devise-v2-2-3-v2-1-3-v2-0-5-and-v1-5-3-released/#comments</comments>
		<pubDate>Mon, 28 Jan 2013 15:03:28 +0000</pubDate>
		<dc:creator>José Valim</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[devise]]></category>
		<category><![CDATA[security fix]]></category>

		<guid isPermaLink="false">http://blog.plataformatec.com.br/?p=3334</guid>
		<description><![CDATA[Hi everybody. I&#8217;d like to announce that Devise v2.2.3, v2.1.3, v2.0.5 and v1.5.4 have been released with a security patch. Upgrade immediately unless you are using PostgreSQL or SQLite3. Users of all other databases (including NoSQL ones) require immediate upgrade. Using a specially crafted request, an attacker could trick the database type conversion code to [...]]]></description>
				<content:encoded><![CDATA[<p>Hi everybody.</p>
<p>I&#8217;d like to announce that Devise v2.2.3, v2.1.3, v2.0.5 and v1.5.4 have been released with a security patch. <strong>Upgrade immediately</strong> unless you are using PostgreSQL or SQLite3. Users of all other databases (including NoSQL ones) require immediate upgrade.</p>
<p>Using a specially crafted request, an attacker could trick the database type conversion code to return incorrect records. For some token values this could allow an attacker to bypass the proper checks and gain control of other accounts.</p>
<p>In case you are using a Devise series older than the ones listed above, recommendations are provided below back to v1.2 series. Regardless, an upgrade to more recent versions is advised.</p>
<h3>Versions affected</h3>
<p>We checked all Devise versions released in the previous two years and recommendations follows as below.</p>
<p><strong>v1.5, v2.0, v2.1 and v2.2 series</strong></p>
<p>You can upgrade to any of v2.2.3, v2.1.3, v2.0.5 and v1.5.4. In case an upgrade is not feasible, please add the following patch to <code>config/initializers/devise_patch.rb</code> inside your Rails application:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#6666ff; font-weight:bold;">Devise::ParamFilter</span>.<span style="color:#9900CC;">class_eval</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> param_requires_string_conversion?<span style="color:#006600; font-weight:bold;">&#40;</span>_value<span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#0000FF; font-weight:bold;">true</span>; <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p><strong>v1.4 series</strong></p>
<p>Please add the following patch to <code>config/initializers/devise_patch.rb</code> inside your Rails application:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#6666ff; font-weight:bold;">Devise::Models::Authenticatable::ClassMethods</span>.<span style="color:#9900CC;">class_eval</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> auth_param_requires_string_conversion?<span style="color:#006600; font-weight:bold;">&#40;</span>value<span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#0000FF; font-weight:bold;">true</span>; <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Please upgrade to more recent versions.</p>
<p><strong>v1.2 and v1.3 series</strong></p>
<p>Not affected by this vulnerability. Please upgrade to more recent versions.</p>
<h3>Upgrade notice</h3>
<p>When upgrading to any of v2.2.3, v2.1.3, v2.0.5 and v1.5.4, some people may be relying on some wrong behaviour to filter data retrieved on authentication. For example, one may have writen in his model:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> find_for_authentication<span style="color:#006600; font-weight:bold;">&#40;</span>conditions<span style="color:#006600; font-weight:bold;">&#41;</span>
  conditions<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:active</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF; font-weight:bold;">true</span>
  <span style="color:#9966CC; font-weight:bold;">super</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>The code above may no longer work and needs to be rewriten as:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> find_for_authentication<span style="color:#006600; font-weight:bold;">&#40;</span>conditions<span style="color:#006600; font-weight:bold;">&#41;</span>
  find_first_by_auth_conditions<span style="color:#006600; font-weight:bold;">&#40;</span>conditions, active: <span style="color:#0000FF; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<h3>Thank you notes</h3>
<p>We would like to thank <b>joernchen of Phenoelit</b> for disclosing this vulnerability and working with us on a patch.</p>
<img src="http://feeds.feedburner.com/~r/PlataformaBlog_english/~4/AYW9MfHpsgc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.plataformatec.com.br/2013/01/security-announcement-devise-v2-2-3-v2-1-3-v2-0-5-and-v1-5-3-released/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		<feedburner:origLink>http://blog.plataformatec.com.br/2013/01/security-announcement-devise-v2-2-3-v2-1-3-v2-0-5-and-v1-5-3-released/</feedburner:origLink></item>
		<item>
		<title>Carlos Antonio da Silva joins the Rails Core team \o/</title>
		<link>http://feedproxy.google.com/~r/PlataformaBlog_english/~3/leqzq8j3Qo4/</link>
		<comments>http://blog.plataformatec.com.br/2013/01/carlos-antonio-da-silva-has-joined-the-rails-core-team/#comments</comments>
		<pubDate>Thu, 03 Jan 2013 09:00:26 +0000</pubDate>
		<dc:creator>Marcelo Park</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[culture]]></category>
		<category><![CDATA[great work]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails core]]></category>

		<guid isPermaLink="false">http://blog.plataformatec.com.br/?p=3250</guid>
		<description><![CDATA[We cannot express how excited we are with such great news. In our last blog post we were celebrating Rafael's achievement and just a few months later we are celebrating again. Years ago, having three Plataformatec teammates as Rails Core members would be something we'd only dream of, but in 2012 it became reality. I must say that it didn't happen by chance, not at all.]]></description>
				<content:encoded><![CDATA[<p>We cannot express how excited we are with such great news. In our last blog post we were celebrating Rafael&#8217;s achievement and just a few months later we are celebrating again. Years ago, having three Plataformatec teammates as Rails Core members would be something we&#8217;d only dream of, but in 2012 it became reality. I must say that it didn&#8217;t happen by chance, not at all.</p>
<div id="attachment_3251" class="wp-caption aligncenter" style="width: 160px"><img class="size-full wp-image-3251" alt="Carlos Antonio da Silva Rails Core team member" src="http://blog.plataformatec.com.br/wp-content/uploads/2013/01/carlos-antonio.jpeg" width="150" height="175" /><p class="wp-caption-text">@cantoniodasilva</p></div>
<p>Carlos has always been an outstanding software developer and a great teammate. He is someone we all deeply trust to solve hard problems and deliver mission critical projects. We&#8217;ve always watched Carlos working really hard and we must say that he deserved every bit of such achievement. You can check out his contributions into many other open source projects at <a href="http://github.com/carlosantoniodasilva">http://github.com/carlosantoniodasilva</a></p>
<p>Kudos to our friend @cantoniodasilva!!! <img src='http://blog.plataformatec.com.br/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/PlataformaBlog_english/~4/leqzq8j3Qo4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.plataformatec.com.br/2013/01/carlos-antonio-da-silva-has-joined-the-rails-core-team/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://blog.plataformatec.com.br/2013/01/carlos-antonio-da-silva-has-joined-the-rails-core-team/</feedburner:origLink></item>
	</channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

 Served from: blog.plataformatec.com.br @ 2013-05-10 17:57:20 by W3 Total Cache -->
