On Oct 12, 10:31 am, Marnen Laibow-Koser
<rails-mailing-l...@andreas-s.net> wrote:
> Joshua Partogi wrote:
> > Hi all,
>
> > Coming from the Java & Hibernate world, I was confused when trying out
> > this piece of line of code:
> > class Task < ActiveRecord::Base
> >   def status=(status)
> >     status = 'P'
> >     write_attribute(:status, status)
> >   end
> > end
>
> This won't quite work.  But before I try to improve it...what are you
> trying to do?  Set status to P no matter the argument that the function
> is called with?
>

Well there are more logic there actually to set the status. I was
hoping that this accessors would be able to set or change the value of
:status. But the behaviours doesn't seems to be like that. So what is
this accessors used for? Is it only for the view level?

Regards,


-- 
Certified Scrum Master
http://blog.scrum8.com | http://jobs.scrum8.com | http://twitter.com/scrum8

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to