Ashley,

> I'm thinking something like this:
>
>    belongs_to :job_role,
>               :default => lambda { |r, p| JobRole.first(:name =>  
> "Boss" ) }
>
> I wrote a spec[1] not long ago to see if the behaviour existed - which  
> it doesn't - but I wasn't sure about putting it on Lighthouse.  
> WDYAT?  Worth filing a ticket?

I think this is good behavior.  I've been slowly adding options that
are available to the underlying property (like :nullable) to the
belongs_to API when it makes sense, and I think the ability to declare
a default parent resource like this fits with the overall API.

If you want to create a ticket, tagged as "suggestion" I'll take a
look at it when I cycle around and do another series of fixes/
refactoring to the Relationship code.

--

Dan
(dkubb)
--~--~---------~--~----~------------~-------~--~----~
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