I have a parent model Account with multiple subclasses using STI. I want to associate another model Transaction using a belongs_to relationship to Account. The referenced account could be either an As
Here is my models: class User <ActiveRecord::Base has_one :worker, :class_name => \'Worker\', :foreign_key => :worker_id
I dont know how to create a worker and a association. So i am able to link those together. I have a type colulm in user.
After switching to Rails 3, I noticed that I have to reboot my server to make STI model classes reload with each request. For example, suppose I have this:
This is my first time working with Single Table Inheritance, and it has been a great experience until pushing the app to Heroku.I have a User model (and table with a type column), a Hauler model that
Hey folks, following problem with Rails and STI: I have following classes: class Account < AC::Base has_many :users
My Rails views and controllers are littered with redirect_to, link_to, and form_for method calls. Sometimes link_to and redirect_to are explicit in the paths they\'re linking (e.g. link_to \'New Perso
I have to implemene Single Table Inheritance for a class Person who can be of type Teacher, Student,Outsider.
I have implemented single table inheritance for a person class class Person < ActiveRecord::Base end
I asked a question earlier about how to structure the data in a simple app I am building to manage content. The answer was to look at Single Table Inheritance and I think it\'s going to be the ticket.