Title is pretty much explanatory. ActiveSupport overrides #to_json, leading to wrong json generated.
http://pastie.org/private/1mgbqwfskokwcs4htkccba
Notice how dm-validations is included after dm-serialize. Bundler doesn't know that dm-validations has some great stuff to be added from dm-serialize and thus can put their requires in any order.
I see some ways to fix this:
- Add #as_json method to ValidationErrors. It should be there anyways. This way, AS will still override #to_json, but will also properly encode your errors
- Ask yehuda to use some stable topological sort (I don't know if there is such a thing at all) thus making it possible to manually manage the requirement order
- Move #to_json / #as_json code to dm-validations instead of dm-serialization -- possibly causes the same problem but reversed
Created by mark - 2010-09-11 06:59:36 UTC
Original Lighthouse ticket: http://datamapper.lighthouseapp.com/projects/20609/tickets/1409