Hi Gabe
This is almost certainly related to your 1.9.3 change - TS will use BasicObject
for the index definition scope, and eval almost certainly doesn't exist in
BasicObject.
To work around it, use Thinking Sphinx's assoc method instead:
indexes assoc("translations_#{ulocale}".to_sym).title, :as =>
:"title_#{ulocale}"
Give that a shot and let us know how you go.
Cheers
--
Pat
On 21/08/2013, at 9:00 PM, Gabe da Silveira wrote:
> I recently upgraded from 2.0.3 to 2.0.14 during the process of upgrading a
> very large app from 3.0.x to 3.1.x and simultaneously from ruby 1.8.7 to
> 1.9.3 (why do something crazy like that? Because performance regressions for
> rails 3.1 under 1.8 caused our test suite to balloon from 30 minutes to 4
> hours).
>
> I have a list of associations (globalize2 translations) based on
> I18n.available_locales which I want to index.
>
> indexes eval("translations_#{ulocale}").title, :as => :"title_#{ulocale}"
>
> This used to work great but now it fails to join the requested association
> tables. I inspected the results of the eval method like so:
>
> $stderr.puts eval("translations_#{ulocale}").inspect
>
> Under 2.0.14 I get:
>
> #<ThinkingSphinx::Index::FauxColumn:0x007fe53ca56378
> @name="translations_pt_br", @stack=[:eval]>
>
> But in 2.0.3 I get:
>
> #<ThinkingSphinx::Index::FauxColumn:0x1085215f8 @name=:translations_pt_br,
> @stack=[]>
>
> So somehow between the Ruby or Rails upgrade, the eval is now being part of
> the faux column stack. I'm also tried using `send` which fails similarly. I
> tried putting the whole thing in an eval block, but that doesn't do anything
> either (I think my mental of eval() is out of date with Ruby 1.9.3).
>
> Is there any way to dynamically define these? Is there anything in TS3 that
> might be of use here?
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Thinking Sphinx" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/thinking-sphinx.
> For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/groups/opt_out.