Hi
I am seing a weird side effect when using the following :-
xx = todo.whens.first.category.name
If I modify the code to the following then I get the behaviour that I
expect.
xx = ''''
xx << todo.whens.first.category.name
I believe that both examples above should be equivalent.
The unexpected behaviour is that a IF test on
todo.whens.first.category.name (not xx) in a later method does not give
the correct outcome. I am calling 2 methods in succession
set_do(todo)
set_due(todo)
Both methods update a different column of a record in the todo table
(but nothing to do with todo.whens.first.category.name)
def set_do(todo)
xx = ''''
xx = todo.whens.first.category.name # this line
has weird side effect
if todo.whens.first.category.name == ''yearly'' # this
test
succedes
...
def set_due(todo)
if todo.whens.first.category.name == ''yearly'' # this
test
does not succede due to weird side effect
...
I have submitted this as a bug in TRAC (1296) which was maybe a bit
premature.
Peter
C:\rails\tb2>gem list
C:\rails\tb2>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem"
list
*** LOCAL GEMS ***
actionmailer (1.0.1, 1.0.0)
Service layer for easy email delivery and testing.
actionpack (1.9.1, 1.9.0)
Web-flow and rendering framework putting the VC in MVC.
actionwebservice (0.8.1, 0.8.0)
Web service support for Action Pack.
activerecord (1.11.1, 1.11.0)
Implements the ActiveRecord pattern for ORM.
activesupport (1.1.1, 1.1.0)
Support and utility classes used by the Rails framework.
fxri (0.3.2)
Graphical interface to the RI documentation, with search engine.
fxruby (1.2.6)
FXRuby is the Ruby binding to the FOX GUI toolkit.
rails (0.13.1, 0.13.0)
Web-application framework with template engine, control-flow layer,
and ORM.
rake (0.5.4)
Ruby based make-like utility.
RMagick-win32 (1.7.0)
RMagick is an interface between the Ruby programming language and
the ImageMagick and GraphicsMagick image processing libraries.
sources (0.0.1)
This package provides download sources for remote gem installation
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails