24 Jan '14, 7pm

ActiveRecord's `where.not` makes queries easier to read:

Gabe Berke-Williams January 22, 2014 rails Rails 4.0 introduced a helpful new method for ActiveRecord queries: where.not . It can make clunky queries easier to read. Usage This query: User.where.not(name: 'Gabe') is effectively the same as this: User.where('name != ?', 'Gabe') It's "effectively" the same because where.not has some extra juice: it will fully qualify the column name with the table name, continue to work if the table or column get aliased (during a left outer join clause with includes), and will continue to work if the database implementation is switched. I've usually seen it used for NOT NULL queries: # Old and busted # User.where('name IS NOT NULL') # New hotness User.where.not(name: nil) But it works with arrays too: # Without `where.not` # Something.where("name NOT IN ?", User.unverified.pluck(:name)) # With `where.not` Something.where.not(name: User.unve...

Full article: http://robots.thoughtbot.com/activerecords-wherenot

Tweets

Wanted to understand ActiveRecord Reflection? H...

api.rubyonrails.org 25 Jan '14, 4am

Reflection enables to interrogate Active Record classes and objects about their associations and aggregations. This inform...

activerecord-oracle_enhanced-adapter (1.5.2): O...

rubygems.org 25 Jan '14, 12am

Oracle "enhanced" ActiveRecord adapter contains useful additional methods for working with new and legacy Oracle databases...

globalize (3.1.0): Rails I18n de-facto standard...

rubygems.org 25 Jan '14, 1pm

Rails I18n de-facto standard library for ActiveRecord model/data translation.

@DJMeloD @djbabuforeal @BEATJUNKIES Love the new T's Did you guys catch @MrChuckD on @ArsenioHall last night. luv

@DJMeloD @djbabuforeal @BEATJUNKIES Love the ne...

shoes4stars.com 25 Jan '14, 7pm

We would like to thank you for visiting today by providing you with the most comfortable and sexy shoes all priced for you...