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_and_password(...)
@session[:user].location_id = @params[:location_id]
end
end
Chris
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails