hi,
i was wondering how this should be handled.imagine i have this class:
class Invoice < ActiveRecord::Base
before_create :setuniqueno
validates_uniqueness_of :uniquenumber
def setuniqueno
self.uniquenumber = Time.now.to_i
end
end
######
class Task<ActiveRecord::Base
end
######
after the user post to the create function i also create an Invoice.
what is not 100% clear to me, is what happens/how should i handle the
case if the uniquenumber is not unique? eg if multiple user generate
the same Timestamp
how does the task-controller get feedback from the Invoice-Model?
im doing a find_or_create_by in the create action of the task.
any pointers? thx
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.