Re: Active Record save doesn't save! (more detail - is this


#1

I got it to work by changing

scheduled_end_date= nil
to
self.scheduled_end_date= nil.

I believe these statements should be equivilent.

I don’t know Ruby/Rails well enough to know when, if or why that should
matter. Can someone educate me please? I want to believe this framework
is
ready for production work, but silently dropping data is a very big
problem. I expect that I’ve done something wrong. I just want to know
what.


#2

Only a roob noob but just read the bit about self and scope in the
excellent Ruby for Rails and I believe self.somemethod can be written as
somemethod except when followed by an assignment (i.e. equals sign).
Ruby thinks somemethod= nil is assigning the value (in this case nil) to
a local variable, somemethod.

Hope this helps


#3

On 4/28/06, Chris T removed_email_address@domain.invalid wrote:

Only a roob noob but just read the bit about self and scope in the
excellent Ruby for Rails and I believe self.somemethod can be written as
somemethod except when followed by an assignment (i.e. equals sign).
Ruby thinks somemethod= nil is assigning the value (in this case nil) to
a local variable, somemethod.

Hope this helps

I guess you’re right. The lack of a requirement to declare variables is
hard
to get used to, especially when I can only do Ruby part time.

Thanks. Time for a code review, I guess.
I need to get that book, everybody says it rocks.