Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9232127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:14:22+00:00 2026-06-18T06:14:22+00:00

I have set up the following models for a contacts directory class Contact <

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:14:23+00:00Added an answer on June 18, 2026 at 6:14 am

    I did a bit of fiddling around and ended up changing the git cource of the rails_sql_views gem in my gemfile to read from git://github.com/flwyd/rails_sql_views.git

    That got rid of the stack level too deep thing however I’m getting a completely new error – my tests are still failing though – for some reason its treating my views as a table. I’ll follow up with a new question on this

    —- UPDATE —–

    I got it working, I made a few alterations in my spec/spec_helper.rb file and commented out the following two lines:

    #config.use_transactional_fixtures = true # because I'm not using fixtures here
    
    #DatabaseCleaner.strategy = :truncation
    

    For some reason Database.strategy config was giving me issues – this is one of those cases where I fixed it but don’t really know how it got fixed. I’ll do some reading into it. In the meantime my tests are running fine now!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following models set up: class Contact < ActiveRecord::Base belongs_to :band belongs_to
I have the following models set up: class Player < ActiveRecord::Base has_many :game_players has_many
I have the following models: class Aircon < ActiveRecord::Base belongs_to :shop belongs_to :brand belongs_to
I have the following models: class Aircon < ActiveRecord::Base belongs_to :shop belongs_to :brand belongs_to
I have the following models: class Product < ActiveRecord::Base belongs_to :brand belongs_to :model accepts_nested_attributes_for
I have the following setup: Models: class Product < ActiveRecord::Base has_one :product_category attr_accessible :name,
I have the following (simplified) model and migration: Model: class User < ActiveRecord::Base attr_readonly
I have a project in which the following models are set up: class User
I have the following models, Member and Map, set up as so: class Member
I have the following sets of models (abbreviated for clarity): First set: class Web(Link):

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.