Last active
May 22, 2016 00:37
-
-
Save EdDeAlmeidaJr/55dadbe031830dc84d63907eb0f32cd8 to your computer and use it in GitHub Desktop.
Adding two ActivreRecord relations - Part 3
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 | |
@customers = Array.new | |
@customers.push(Customer.find(1)) | |
Customer.where.not(id: 1).order(:name).each{ |rec| @customers.push(rec) } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment