hi, I have simple has many through association which is working without problem on ruby 1.8.6 and rails 2.0.2, but on ruby-enterprise with ruby 2.0.2 or 2.3.2 it just does not see "through" part of association.
class User < ActiveRecord::Base has_many :userships has_many :user_groups, :through => :userships end class UserGroup < ActiveRecord::Base has_many :userships has_many :users, :through => :userships end class Usership < ActiveRecord::Base belongs_to :user belongs_to :user_group end
as i am moving app to new server, i am getting these errors:
ActiveRecord::StatementInvalid: Mysql::Error: Unknown column 'user_groups.user_id' in 'where clause': SELECT * FROM `user_groups` WHERE (`user_groups`.user_id = 8) from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/ activerecord-2.3.2/lib/active_record/connection_adapters/ abstract_adapter.rb:212:in `log' from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/ activerecord-2.3.2/lib/active_record/connection_adapters/ mysql_adapter.rb:320:in `execute' from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/ activerecord-2.3.2/lib/active_record/connection_adapters/ mysql_adapter.rb:595:in `select' from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/ activerecord-2.3.2/lib/active_record/connection_adapters/abstract/ database_statements.rb:7:in `select_all_without_query_cache' from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/ activerecord-2.3.2/lib/active_record/connection_adapters/abstract/ query_cache.rb:62:in `select_all' from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/ activerecord-2.3.2/lib/active_record/base.rb:661:in `find_by_sql' from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/ activerecord-2.3.2/lib/active_record/base.rb:1553:in `find_every' from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/ activerecord-2.3.2/lib/active_record/base.rb:615:in `find' from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/ activerecord-2.3.2/lib/active_record/associations/ association_collection.rb:60:in `find' from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/ activerecord-2.3.2/lib/active_record/associations/ association_collection.rb:395:in `find_target' from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/ activerecord-2.3.2/lib/active_record/associations/ association_collection.rb:349:in `load_target' from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/ activerecord-2.3.2/lib/active_record/associations/association_proxy.rb: 139:in `inspect'
obviously, association is not correctly understood by ruby and "through" part of it is not taken
anybody having similar problem? any ideas?