Displaying 1 result from an estimated 1 matches for "owned_th".
Did you mean:
owned_by
2005 Nov 03
0
AR model and virtual attributes
i have a need to create a ''virtual'' attribute. Is the following possible?
class User < ActiveRecord::Base
# user things are owned by user at his selected location
has_many :owned_things, :class_name => "Thing", :conditions => ''user_id =
#{id} and location_id = #{location_id}''
attr_accessor :location_id
end
class AccountController < ApplicationController
def login
# load user info and set location
@session[:user] = User.find_by_username_a...