property :world_region_id, Integer, :default => 1

2009/10/14 George <[email protected]>

>
> Hi all,
>
> For normal properties we can specify a default like this:
>  property :title, String, :default => "Mr"
>
> How do we do it for properties added by "belongs_to" and "has n"?
>
> For example:
>  Country model belongs_to :worldRegion
>  WorldRegion has n, :countries
>  I'd like world_region_id of a new Country to default to, say, "1"
>
> Many thanks
> George
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" 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/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to