Forum: Ruby on Rails RE: Re: RC5 Mysql Troubles

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.
D244b90a6f2540ca14772f79b694f0ec?d=identicon&s=25 jeff.gray (Guest)
on 2005-12-09 20:31
(Received via mailing list)
I have username and password.  Same error.  Haven't changed anything
after upgrading to RC5.  Database error started after upgrading.
36df5a25b0f7e1a39826370b91497167?d=identicon&s=25 charlesleeds (Guest)
on 2005-12-09 22:17
(Received via mailing list)
I have the following code snippet and I don't understand why the
logger.info "Datestr" line is always logging to the log file before the
"Scope 2.1" line when it clearly succeeds, not precedes "Scope 2.1" in
the code.  Shouldn't this code always produce a Datestr when given an
empty params[:scope]??

And how is it even freakin possible that I get an empty @datestr when I
assign it if both clauses of an if -> else -> end statement?

  def noway
        @scope = "empty"
        logger.info "Scope 1: #@scope"

        if params[:scope]
            @scope = params[:scope]
            logger.info "Scope 2.2: #@scope"
        else
            @scope = "last three days"
            logger.info "Scope 2.1: #@scope"
        end if

        if @scope == "last three days"
            @datestr = (Date.today - 3).strftime("%Y/%m/%d")
        else
            @datestr = "empty"
        end if

        logger.info "Datestr: #@datestr"
        render :text => 'hello'
    end

Development.log
-----
Processing DashboardController#noway (for 10.6.15.149 at 2005-12-09
15:37:35) [GET]
  Parameters: {"action"=>"noway", "controller"=>"dashboard"}
Scope 1: empty
Datestr:
Scope 2.1: last three days
Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB:
0.00000 (0%) | 200 OK [http://matterhorn/serveradm/dashboard/noway]
This topic is locked and can not be replied to.