karmi/tire — Issue #239: indexes :as proc option runs in class context
Author: trollybaz
Created: 2012-02-11 04:52:54+00:00
State: open

I'm somewhat new to tire and I can't seem to get the :as option working for my AR model. I'm trying to specify the value for an indexed field using a proc:

```
indexes :comments, :as proc { comments.size }

or

indexes :comments do
comments.size
end
```

Looking at the code in indexes() it does a yield, which runs the block in the context of the class instead of the instance. Am I missing something?