Posts Tagged ‘bug’

Temporary fix for the DataMapper bug

Wednesday, April 9th, 2008

If like me you’re plagued by this DataMapper bug that kills your test cases. I’ve packaged up a temporary version of the DataMapper gem that seems to fix the problem.

WARNING: This gem is NOT sanctioned by the DataMapper team. Use at your own risk.

If you use this gem and find any issues, please let me know. Also, if you use this gem and things seem to be working just fine, then please let me know that too. Good luck!

DataMapper-0.3.0.1.gem

The state of migrations and the distributed routes rework

Wednesday, April 9th, 2008

I was really hoping to get the rewrite of distributed routes using Rinda, as well as migration support for both ActiveRecord and DataMapper out either today, or by the end of the week. As it turns out, because of the Class bug in DataMapper 0.3.0 it doesn’t look like that’s going to happen till early next week. Sorry about that folks. I’ve lost a lot of time on the DataMapper thing, but I’ve got a work around, locally anyway, that is allowing me to keep developing. As soon as I get it all done, I’ll be very happy to release it all. Stay tuned.

Horrible bug in DataMapper 0.3.0

Wednesday, April 9th, 2008

http://wm.lighthouseapp.com/projects/4819-datamapper/tickets/185-including-comparable-in-class-class-breaks-test-unit-and-probably-more#ticket-185-8

In the gem at the bottom of lib/data_mapper/support/typed_set.rb there is the following code:

class Class
  include Comparable
  def <=>(other)
    name <=> other.name
  end
end

This causese Test::Runner to through up an error similar to this:

/usr/local/lib/ruby/1.8/test/unit/collector/objectspace.rb:25:in `collect': undefined method `suite' for Gem::LoadError:Class (NoMethodError)
from /usr/local/lib/ruby/1.8/test/unit/collector/objectspace.rb:23:in `each_object'
from /usr/local/lib/ruby/1.8/test/unit/collector/objectspace.rb:23:in `collect'
from /usr/local/lib/ruby/1.8/test/unit/autorunner.rb:58
from /usr/local/lib/ruby/1.8/test/unit/autorunner.rb:213:in `[]'
from /usr/local/lib/ruby/1.8/test/unit/autorunner.rb:213:in `run'
from /usr/local/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run'
from /usr/local/lib/ruby/1.8/test/unit.rb:278
from /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader.rb:5
rake aborted!

It also causes your tests to blow up and not run. Which, if you’re trying to do any development causes some real problems! If you comment out ‘include Comparable’ from Class things seem to work just fine. I say seem, because I haven’t done any real extensive testing with this. The other thing you can do is revert to 0.2.5, but that’s up to you. Either way, it’s not really optimal. Let’s hope they fix this soon.