Last active
May 22, 2016 00:18
-
-
Save EdDeAlmeidaJr/5535212a17a613b011e20ed0580c9a99 to your computer and use it in GitHub Desktop.
Adding two ActiveRecord relations - Part 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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