single-table-inheritance
Dynamically typed associations with STI models
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[详细]
2023-02-06 00:37 分类:问答Rails devise add fields to registration form when having STI
Here is my models: class User <ActiveRecord::Base has_one :worker, :class_name => \'Worker\', :foreign_key => :worker_id[详细]
2023-02-04 03:52 分类:问答Rails devise registration form when having STI
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.[详细]
2023-02-03 15:31 分类:问答How to make Rails 3 reload STI classes in development mode?
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:[详细]
2023-02-03 06:05 分类:问答Heroku STI Problem
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[详细]
2023-02-02 05:08 分类:问答ActiveRecord Problems using callbacks and STI
Hey folks, following problem with Rails and STI: I have following classes: class Account < AC::Base has_many :users[详细]
2023-02-01 03:19 分类:问答Best practices to handle routes for STI subclasses in rails
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[详细]
2023-01-31 23:04 分类:问答Form helpers in case of Single Table Inheritance
I have to implemene Single Table Inheritance for a class Person who can be of type Teacher, Student,Outsider.[详细]
2023-01-30 11:51 分类:问答Broken Rails Routes after implementing Single Table Inheritance
I have implemented single table inheritance for a person class class Person < ActiveRecord::Base end[详细]
2023-01-30 03:50 分类:问答How does the :type field get populated in Single Table Inheritance?
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.[详细]
2023-01-28 15:13 分类:问答
加载中,请稍侯......