jashmenn/activeuuid — Issue #1: using activeuuid with sqlite
Author: Raven24
Created: 2011-11-02 20:26:21+00:00
State: open

Hi!

I am currently trying to get this gem to work with sqlite so that it can be used in a default rails development environment. I have already worked on some issues that prevented a new entry from being saved and now I am having issues retrieving data from the database by its uuid. This is what I am currently using:

```
> Person.find(UUIDTools::UUID.parse("0320cdfa-04d2-11e1-a1a1-14dae903e06a"))
/home/florian/.rvm/gems/ruby-1.8.7-p352@contacts/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/quoting.rb:46: warning: Object#id will be deprecated; use Object#object_id
Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", #]]
ActiveRecord::RecordNotFound: Couldn't find Person with id=0320cdfa-04d2-11e1-a1a1-14dae903e06a
from /home/florian/.rvm/gems/ruby-1.8.7-p352@contacts/gems/activerecord-3.1.1/lib/active_record/relation/finder_methods.rb:339:in `find_one'
from /home/florian/.rvm/gems/ruby-1.8.7-p352@contacts/gems/activerecord-3.1.1/lib/active_record/relation/finder_methods.rb:310:in `find_with_ids'
from /home/florian/.rvm/gems/ruby-1.8.7-p352@contacts/gems/activerecord-3.1.1/lib/active_record/relation/finder_methods.rb:107:in `find'
from /home/florian/.rvm/gems/ruby-1.8.7-p352@contacts/gems/activerecord-3.1.1/lib/active_record/base.rb:441:in `__send__'
from /home/florian/.rvm/gems/ruby-1.8.7-p352@contacts/gems/activerecord-3.1.1/lib/active_record/base.rb:441:in `find'
from (irb):1
```

From my tests I can say that the Arel::Visitor is never used and it looks like ActiveRecord is trying to use the to_s method of the UUID object. This, of course, is then not the right way to retrieve an entry...

Maybe someone can help me with that ... I will put a fork on github a little later.