I lean towards what Adam suggested: if there is a way already to do it  
effortlessly, maybe even
it is an eye soar to some, no need to add more code to -core.
More code means more bugs, slower execution
and more spec examples to add to some (at first glance unrelated)  
places. Yes, I am totally
merb-brain-damaged and all that.

This particular feature can be a plugin. It would require some simple  
refactoring in -core,
but this is what -core is all about: being open for extension.

What we end up with for now:
http://datamapper.lighthouseapp.com/projects/20609-datamapper/tickets/771

On 14.01.2009, at 18:18, heda wrote:

> too messy when you have sets of options
>
> opts = {:auto_validation => false}
> opts_string = opts.merge({:size => 50})
> opts_decimal = opts.merge({:precision => 10, :scale => 4})
>
> property :firstname, String, opts_string
> property :lastname, String, opts_string
>
> property :minimum, BigDecimal, opts_decimal.merge({:nullable =>
> false})
> property :maximum, BigDecimal, opts_decimal
>
> =====
>
> much cleaner and easier to read with something like
>
> with_default_options {:auto_validation => false} do
>
>  with_default_options {:size => 50} do
>    property :firstname, String
>    property :lastname, String
>  end
>
>  with_default_options {:precision => 10, :scale => 4} do
>    property :minimum, BigDecimal, :nullable => false
>    property :lastname, BigDecimal
>  end
>
> end


MK


--~--~---------~--~----~------------~-------~--~----~
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