Forum: Ruby on Rails Re: Active Record save doesn't save! (more detail - is this

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.
Larry W. (Guest)
on 2006-04-29 00:09
(Received via mailing list)
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.
Chris T (Guest)
on 2006-04-29 02:11
(Received via mailing list)
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
Larry W. (Guest)
on 2006-04-29 04:07
(Received via mailing list)
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.
This topic is locked and can not be replied to.