ernie/ransack — Issue #48: ransack stopped working with Rails 3.2.0.rc1 (Arel 3.0.0.rc1)
Author: khustochka
Created: 2011-12-20 10:15:52+00:00
State: open

Rails 3.2.0.rc1
Arel 3.0.0.rc1
Ransack 0.5.8

`Person.search(params[:q])` fails with error

undefined method `schema_cache' for ActiveRecord::Base:Class

top of stacktrace

```
activerecord (3.2.0.rc1) lib/active_record/dynamic_matchers.rb:50:in `method_missing'
arel (3.0.0.rc1) lib/arel/visitors/to_sql.rb:11:in `initialize'
arel (3.0.0.rc1) lib/arel/visitors.rb:34:in `new'
arel (3.0.0.rc1) lib/arel/visitors.rb:34:in `block in '
arel (3.0.0.rc1) lib/arel/visitors.rb:38:in `yield'
arel (3.0.0.rc1) lib/arel/visitors.rb:38:in `default'
arel (3.0.0.rc1) lib/arel/visitors.rb:38:in `visitor_for'
ransack (0.5.8) lib/ransack/context.rb:37:in `initialize'
ransack (0.5.8) lib/ransack/context.rb:17:in `new'
ransack (0.5.8) lib/ransack/context.rb:17:in `for_class'
ransack (0.5.8) lib/ransack/context.rb:11:in `for'
ransack (0.5.8) lib/ransack/search.rb:18:in `initialize'
```

The problem is that Arel::Visitors::ToSql#initialize expects connection adapter as argument but it gets ActiveRecord::Base.

This could be also bug of Arel RC so I am sorry if I posted it inappropriately.