sti Questions
2
I have a product model that has many sections, and a section can belong to many products.
The section model has subclasses of Feature, Standard and Option.
My models are:
class Product < Acti...
Assimilative asked 16/6, 2009 at 23:28
2
I have a module that I'm including in several models with this content:
self.class.find_by_foo(bar)
Everything was fine until I started using STI. That line should always generate the query
se...
Stefanistefania asked 11/2, 2012 at 17:52
2
Solved
I would like to be able to call the build method on a scope that targets a certain class of model via its STI type, and have ActiveRecord build an instance of the correct class.
class LineItem <...
Huei asked 9/7, 2012 at 0:29
4
I'm trying to figure out the best way to manage my controller(s) and models for a particular use case.
I'm building a review system where a User may build a review of several distinct types with a...
Hightower asked 22/3, 2012 at 14:58
2
Solved
I think I need to use STI in Rails.
Here's my class:
class Person < ActiveRecord::Base
end
class Landlord < Person
end
and the people table has a :type column that's a string.
So, what ...
Prevenient asked 1/2, 2011 at 1:54
3
Solved
Are there standards or best practices yet when it comes to multi table inheritance in rails 3? So far the best article I could find was:
http://mediumexposure.com/multiple-table-inheritance-active...
Esma asked 16/2, 2011 at 22:14
2
Solved
I've been banging my head against a wall trying to wrap my head around this, so any guidance would be much appreciated...
I want to have a User system setup to reflect the following hierarchy:
Us...
Civilly asked 11/12, 2010 at 16:28
© 2022 - 2024 — McMap. All rights reserved.