very newbie question. I am using the Rails 3 query interface as shown below:
class User < ActiveRecord::Base def self.authenticate if Rails.env = 'development' self.where('username = ?', 'development_user') else self.where('username = ?', request.env['REMOTE_USER']) end end end
This returns an ActiveRecord :: Relation object, where in fact I want the User object to be associated with the request. How to turn this into a User object?
Nick barrett
source share