Hello Pat,
I have been able to reproduce the problem by creating a new rails
application
from scratch with thinking-sphinx installed as a vendor plugin.
If I do the following:
* Execute "rails test_app"
* Configure the development environment to run with cache_classes set
to true (to mimic production)
* Create the migrations and define models with indexes (as listed
below)
* Generate an Observer on the Order model: "ruby script/generate
observer Order"
* Activate the OrderObserver within environment.rb
* Execute: "rake ts:config && rake ts:index"
I get the same error that I've been harping on about ;o)
As soon as I disable the observer, and re-configure thinking-sphinx; I
am able to rotate my indexes correctly.
So it appears to be related to my use of an Observer on the Order
model.
Note: The observer is "as generated" without any additional code.
I hope this clarifies the problem I have been having.
Kind regards, Oliver.
======
Models:
======
class Order < ActiveRecord::Base
belongs_to :customer
define_index do
indexes customer.account_ref, :as => :account_ref
indexes [customer.contact_name, customer.company_name], :as
=> :customer_name
end
end
class Customer < ActiveRecord::Base
has_many :orders
define_index do
indexes :account_ref
indexes :contact_name
indexes :company_name
end
end
========
Migrations:
========
class CreateCustomers < ActiveRecord::Migration
def self.up
create_table :customers do |t|
t.account_ref, :string
t.contact_name :string
t.company_name :string
t.timestamps
end
end
def self.down
drop_table :customers
end
end
class CreateOrders < ActiveRecord::Migration
def self.up
create_table :orders do |t|
t.customer_id :integer
t.timestamps
end
end
def self.down
drop_table :orders
end
end
> ...
>
> read more »