28 May '15, 7pm

Need to put conditions on that table you're doing an .includes on in #rails? No problem:

Specify relationships to be included in the result set. For example: users = User.includes(:address) users.each do |user| user.address.city end allows you to access the address attribute of the User model without firing an additional query. This will often result in a performance improvement over a simple join . You can also specify multiple relationships, like this: users = User.includes(:address, :friends) Loading nested relationships is possible using a Hash: users = User.includes(:address, friends: [:address, :followers]) conditions If you want to add conditions to your included models you'll have to explicitly reference them. For example: User.includes(:posts).where('posts.name = ?', 'example') Will throw an error, but this will work: User.includes(:posts).where('posts.name = ?', 'example').references(:posts) Note that includes works with association names while refer...

Full article: http://api.rubyonrails.org/classes/ActiveRecord/QueryMeth...

Tweets

5 Ways to Put Your Pet’s Breath on a Leash

5 Ways to Put Your Pet’s Breath on a Leash

care2.com 23 May '15, 11pm

Ah, a nice night on the couch with the latest episode of your favorite show and a cup of tea. Time for your furry friend t...

INFOGRAPHIC: Our ocean plastic problem is quick...

inhabitat.com 28 May '15, 8pm

Try to imagine your life without plastic: it’s in your smartphone, your car, your clothing, your toiletries. All that plas...

The ‘Taproom of the Future’ is Coming to Northe...

dailycoffeenews.com 29 May '15, 4pm

Braxton is pitching the new facility as a kind of a small-business incubation hub, citing its own growth history as well a...

Excalibur Knights Of The Round Table II From @R...

WardrobeTrendsFashion.com 24 May '15, 8am

Roger Dubuis has a well-established reputation for springing surprises in many guises, and its contemporary take on the le...

Ruby on Rails Team Leader #empleo #trabajo

infoempleo.com 29 May '15, 11am

We are looking for a Senior Ruby on Rails Developer with leadership skills to occupy a role as the subject matter expert o...

Need Timing Diagrams? Try Wavedrom

hackaday.com 25 May '15, 2pm

When working with anything digital, you’re going to end up reading or writing a timing diagram before long. For us, that’s...

Russian Official: 'Tanks Don't Need Visas' via @defense_news

Russian Official: 'Tanks Don't Need Visas' via ...

defensenews.com 25 May '15, 8pm

Russian President Vladimir Putin, left, listens to Russia's Vice Prime Minister Dmitry Rogozin during a March 17 meeting o...

New Job Alert: Need Technical Writers for Ruby,...

freelancer.com 21 May '15, 12pm

Skills Required Ruby Ruby on Rails Project Budget ₹1500 - ₹12500 INR Total Bids 2 Project Description We need people who h...

Senior Rails Engineer at: United States, Newton...

jobs.rubynow.com 22 May '15, 1pm

Booster, the revolutionary online awareness and fundraising platform, is looking for great Senior Engineers. As a key memb...

New Job Alert: Need People who prepare tutorial...

freelancer.com 21 May '15, 6am

We need people who are technically strong in ruby, ruby on rails, phython and perl to prepare tutorials for all topics in ...

Some of the biggest websites in the world are b...

learn.onemonth.com 21 May '15, 5pm

Getting Started 10 Reasons Beginners Should Learn Ruby on Rails By Mattan Griffel On April 22, 2015 If you're new to progr...

INFOGRAPHIC: How food waste has become a huge g...

inhabitat.com 20 May '15, 2pm

Every year, an estimated 1.2 to 2 billion tons of food is wasted—a massive amount of food that, if saved, would be more en...

NEED RUBY ON RAILS DEVELOPERS by OriginDharmesh...

freelancer.com 16 May '15, 8am

I would love to work in a environment where I am open to suggest any thing that can be used for betterment of things (appl...

How to shoot better scores in windy conditions:

golfwrx.com 21 May '15, 12pm

First, I had to determine how I wanted to measure the data. What I discovered early on is that, speaking generally, the be...

Rails Quick Tip: Easy ActiveRecord Optimizations.

hashrocket.com 27 May '15, 2pm

Note, email validator was updated to screen name validator. User.where(email: emails).empty? would be enough to check if e...