svenfuchs/globalize3 — Issue #102: endless loop in lib/globalize/active_record/instance_methods.rb
Author: cure
Created: 2012-02-07 03:29:14+00:00
State: open

I have a dead simple model:

class CreateCountries < ActiveRecord::Migration
def up
create_table :countries do |t|
t.integer :zipcode_order
t.integer :state_order

t.column "created_by", :string, :limit => 100, :null => false, :default => ''
t.column "updated_by", :string, :limit => 100, :null => false, :default => ''
t.column "lock_version", :integer, :null => false, :default => 0
t.column "deleted_at", :timestamp
t.timestamps
end
Country.create_versioned_table
Country.create_translation_table! :name => :string
end

def down
drop_table :countries
Country.drop_versioned_table
Country.drop_translation_table!
end
end

When I do this in the rails console, the code gets stuck in lib/globalize/active_record/instance_methods.rb

$ rails c
Loading development environment (Rails 3.1.3)
irb(main):001:0> c = Country.new
=> #
irb(main):002:0> c.name='test'
....

I need to press ctrl-c twice to get out.

I get endless repeats of this line in the logs

DEPRECATION WARNING: primary_key_name is deprecated and will be removed from Rails 3.2 (use foreign_key instead). (called from translation_for at .../.bundler/ruby/1.8/globalize3-38d332b22d79/lib/globalize/active_record/instance_methods.rb:133)

and cpu usage is high. This happens against the latest tree from git.

Help?