[Sdrug] 2 Model Questions
brez
jbresnik at gmail.com
Sat Jul 8 00:40:40 GMT 2006
re. #1
Maybe the question is phrased wrong [?] but the relationship is created
automatically as a result of your has_one statement in the applicable
model.. ?
re. #2
It's possible to give default values when you create an object, i.e.
x = Address.new :street => '123 Main St', :zipcode => '92101'
not sure if fixtures are applicable for this?
brez
On 7/7/06, Chris Abad <chris at integralimpressions.com> wrote:
>
> Okay, I'm stumped. Any ideas on these two?
>
> 1. Upon creating a new model object, I'd like it to automatically
> create the associated has_one object. I can do this in the controller
> code... but that means I have to remember each time I create that
> object. I'm hoping for a way to put this in the model itself.
>
> 2. Upon creating a new model object, I'd like to automatically load
> default parameters using a fixture. Again, ideally I'd like to do
> this once within the model itself.
>
> Any ideas? Thanks in advance.
> _______________________________________________
> Sdrug mailing list
> Sdrug at lists.sandiegorug.org
> http://lists.sandiegorug.org/mailman/listinfo/sdrug
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://comox.textdrive.com/pipermail/sdruby/attachments/20060708/9976d597/attachment.htm
More information about the Sdruby
mailing list