Skip to content

Instantly share code, notes, and snippets.

@EdDeAlmeidaJr
Last active May 22, 2016 00:12
Show Gist options
  • Save EdDeAlmeidaJr/b35faa455d401313a29e1d2dabd9a6eb to your computer and use it in GitHub Desktop.
Save EdDeAlmeidaJr/b35faa455d401313a29e1d2dabd9a6eb to your computer and use it in GitHub Desktop.
Adding two ActiveRecord relations - Part 1
class CustomersController < ApplicationController
def index
a = Customer.find(1)
b = Customer.where.not(id: 1).order(:name)
@customers = a + b
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment