Skip to content

Instantly share code, notes, and snippets.

@EdDeAlmeidaJr
Last active May 22, 2016 00:37
Show Gist options
  • Save EdDeAlmeidaJr/55dadbe031830dc84d63907eb0f32cd8 to your computer and use it in GitHub Desktop.
Save EdDeAlmeidaJr/55dadbe031830dc84d63907eb0f32cd8 to your computer and use it in GitHub Desktop.
Adding two ActivreRecord relations - Part 3
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