Skip to content

Instantly share code, notes, and snippets.

@EdDeAlmeidaJr
Last active May 22, 2016 00:18
Show Gist options
  • Save EdDeAlmeidaJr/5535212a17a613b011e20ed0580c9a99 to your computer and use it in GitHub Desktop.
Save EdDeAlmeidaJr/5535212a17a613b011e20ed0580c9a99 to your computer and use it in GitHub Desktop.
Adding two ActiveRecord relations - Part 2
class CustomersController < Applicationcontroller
def index
a = Customer.where(id: 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