reload!; o=Order.find(2); o.exported!; puts Order.find(2).exported_at
=> nil
in order.rb:
...
def exported!
res = false
if self.exported_at.nil?
self.exported_at = Time.now
res = self.save
else
res = true
end
order_lines.each do |order_line|
order_line.exported_at = Time.now
order_line.save
end
res
end
...
I have no idea why it does not work :( Maybe someone sees something
strange here?
Cheers,
Tomasz
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---