Forum: Ruby on Rails Oracle OraNumber problem with Authentication. Please help!

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Chris (Guest)
on 2006-02-28 13:15
I have added an authenticator using the instructions here:
http://wiki.rubyonrails.org/rails/pages/HowtoAuthenticate

The LoginController sets session["employee"] to an employee.
When i try to access the session["employee"] from another controller i
get this error :

"
TypeError (no marshal_dump is defined for class OraNumber):
    c:/ruby/lib/ruby/1.8/pstore.rb:159:in `dump'
    c:/ruby/lib/ruby/1.8/pstore.rb:159:in `dump'
    c:/ruby/lib/ruby/1.8/pstore.rb:138:in `transaction'
    ......
"

As you can tell i am using Oracle as the DB.  I have added
model:employee to all the controllers that use it and to application.rb.

This is the code :

class LoginController < ApplicationController

  model :employee

  .....

  def authenticate
    if employee = Employee.authenticate(@params["username"],
@params["password"])
      session["employee"] = employee
      if session["return_to"]
        redirect_to_path(@session["return_to"])
        session["return_to"] = nil
      else
        redirect_to :controller => "weblog"
      end
    else
      flash["alert"] = "Login failed!"
      redirect_to :action => "index"
    end
  end
 ....
end

The class i access session["employee"] from:

class TimesheetController < ApplicationController

  model :employee
  before_filter :authenticate

  protected
  def authenticate
    unless session["employee"]
      session["return_to"] = @request.request_uri
      redirect_to :controller => "login"
      return false
    end
  end

end

I am really stuck and any help would be really appreciated.  I know i
could change the column types in the table from number to integer but i
am NOT allowed to do this.  For now i can get by passing the employee.id
to the session, but this is not ideal.

Thanks,
Chris
Michael Schoen (Guest)
on 2006-03-03 05:46
(Received via mailing list)
> I am really stuck and any help would be really appreciated.  I know i
> could change the column types in the table from number to integer but i
> am NOT allowed to do this.  For now i can get by passing the employee.id
> to the session, but this is not ideal.

What version of Ruby/OCI are you using?
This topic is locked and can not be replied to.