I have set up the following models for a contacts directory
class Contact < ActiveRecord::Base
acts_as_citier
end
class Company < Contact
acts_as_citier
end
class Operator < Company
acts_as_citier
end
The thing is that a Contact can be a company and operator is a kind of company with added different attributes.
Since single table inheritance wasnt working for this particular application I decided to use the citier gem.
In the end I have three tables for each model. So when I add a Company object I get two entries made i.e one in Contact with just the name attribuet and the other attributes in the Company table sharing the same id across both tables with the type field of both tables set to Company. If I add an Operator three entires are made i.e one in each table sharing the same id with the Type field of the first two tables set to Operator.
My application works fine apparently, however all of my tests are broken i.e those concerning these models - plus the worst part is that the stack level is too deep as I get the following error message for all broken tests.
Failure/Error: Unable to find matching line from backtrace
SystemStackError:
stack level too deep
# /home/ali/.rvm/gems/ruby-1.9.2-p318/bundler/gems/rails_sql_views-0cf1af369a5f/lib/rails_sql_views/connection_adapters/abstract_adapter.rb:23
I did a check of the rails_sql_views/connection_adapters/abstract_adapter.rb
file atleast for the line number in the above error and it just has this line:
self.class.send(:alias_method, :tables, :original_tables_method)
I'm using a postgresql database here.
Thats around 300 tests all broken with the same message :(
Note all the broken tests are those which involve any kind of change to these models.