29 Nov '16, 1pm

Use #merge in #rails for filtering using a join model. Super clean and concise!

# The person, a real object class Person < ActiveRecord::Base # Every computer that person has access to has_many :accounts has_many :computers, :through => :accounts # Only comps that this account can administrate has_many :administrator_accounts, :class_name => 'Account::Administrator' has_many :administrated_computers, :through => :administrator_accounts, :source => :computer end # The account - a relationship (<3) between a person and a computer class Account < ActiveRecord::Base belongs_to :person belongs_to :computer # The administrator subclass - here we're using a `default_scope` rather than just normal STI with a `type` field (which I prefer) class Administrator < Account default_scope lambda { where(:role => 'administrator') } end end # The computer being used class Computer < ActiveRecord::Base # [ALL] Users has_many :accounts has_many :people, :through => :acco...

Full article: https://coderwall.com/p/9xk6ra/rails-filter-using-join-mo...

Tweets

Join us tonight to learn about using Rails with...

meetup.com 29 Nov '16, 3pm

Getting your app running locally is easy. Getting it running on your CI/CD and production environment is hard. Let’s explo...

From now until the end of the year, #Join #TLPA...

tlpa.org 29 Nov '16, 7pm

Join Today & Save! If your organization has never been a member or hasn't been one in 3 years, sign up for 2017 and get th...

Why Tesla Model 3 should use standard model-yea...

greencarreports.com 28 Nov '16, 2pm

Tesla Motors production line for Tesla Model S, Fremont, California Enlarge Photo Electric-car maker Tesla Motors has alwa...

Using Open Government for Climate Action

Using Open Government for Climate Action

wri.org 28 Nov '16, 7pm

Countries made many national climate commitments as part of the Paris Agreement on climate change, which entered into forc...

Using open government for climate action

eco-business.com 30 Nov '16, 8am

Countries made many national climate commitments as part of the Paris Agreement on climate change, which entered into forc...

Tesla Model 3 Manufacturing, India’s Clean & Di...

cleantechnica.com 27 Nov '16, 2pm

Does Tesla Model 3’s Large Glass Roof Make Manufacturing Much Easier & Quicker? (via Gas2 ) India Wants To Be Solar Superp...

What if I Tell You That Ruby on Rails Is Scalable

What if I Tell You That Ruby on Rails Is Scalable

rubygarage.org 29 Nov '16, 9am

Ruby on Rails is a great framework for startups, but we often hear people talk about Rails scalability issues when a start...

Toptal: Ruby on Rails Developer

weworkremotely.com 28 Nov '16, 9pm

Toptal is one of the most innovative and rapidly expanding tech start-ups from Silicon Valley. With backing from investors...

Main Reasons You Should Try Ruby on Rails

ikantam.com 28 Nov '16, 7pm

Ruby on Rails is one of the most popular frameworks. Since 2005, the year the first version was released, the framework ha...

Ruby on Rails & #AngularJS: Resources

dillonbuchanan.com 29 Nov '16, 3pm

I'm a huge fan of AngularJS and an even bigger fan of Ruby on Rails. However, one of the gripes I have with AngularJS is t...

Using PostgreSQL instead of Rails to generate JSON

rubyflow.com 25 Nov '16, 11am

× The Ruby and Rails community linklog Made a library? Written a blog post? Found a useful tutorial? Share it with the Rub...

Using Sublime Text for a Rails Project #sublime...

rails.devcamp.com 23 Nov '16, 12am

Using Sublime Text for a Rails Project Learn Rails from Scratch / Building your first Rails Application / Jordan Hudgens /...

Consumer Reports' view of Tesla Model X: 'fast ...

greencarreports.com 29 Nov '16, 12pm

Stephen Edelstein Nov 29, 2016 2016 Tesla Model X Enlarge Photo Consumer Reports has an interesting relationship with Tesl...

New Remote Job Posted: Ruby on Rails Developer

remoteworking.co 28 Nov '16, 11pm

Toptal is one of the most innovative and rapidly expanding tech start-ups from Silicon Valley. With backing from investors...