ActiveRecord::NamedScopes (2.3.x) obtaining the SQL conditions

It's a good pratice to chain several named scopes like:

Property.listable.for_2_or_more_guests.best_10_properties

Now, to make the lesson more valuable let's assume the following code:

Property.scoped(:conditions => "foo = 2").scoped(:conditions => "foo2 IS NOT NULL")

Next, if you want to be able to fetch the underlying conditions scope generated by ActiveRecord. You must do this:

Property.scoped(:conditions => "foo = 2").scoped(:conditions => "foo2 IS NOT NULL").scope(:find)
# => {:conditions => "(foo = 2) AND (foo2...

Git Branch naming

This is how we name branches :

  • <team>/<story>-<id> (features)
  • fix/<team>/<story>-<id> (bugs)

story is an dash-delimited version of the story name, and id the Pivotal story number.

Examples :

  • supply/belvilla-naming-1234567
  • fix/tripadvisor/property-syncing-3256674
  • integration/geo/boroughs