sti
STI and virtual attribute inheritance (Rails 2.3)
Say I have an STI relationship, where Commentable is the super class, and NewsComment is the subclass.In Commentable I have:[详细]
2023-04-10 17:59 分类:问答Rails 2.3 STI return all child classes
I am using standard STI and want to create an input select on a form whose options are all child type of the parent开发者_StackOverflow class. So I\'d like Parent.select_options to return [\'Child1\',[详细]
2023-04-05 10:24 分类:问答metasearch has_many where all/none has to match
Im trying to make a metasearch or alternatively a scope that gives me all objects that doesnt have any of its has_many-association equal to type == \"Something\".[详细]
2023-04-04 08:04 分类:问答ActiveRecord STI: How can I break out of the parent class' default scope
On Rails 3.1 RC6, given class Animal < ActiveRecord::Base default_scope where(legs: 4) end The following does not work as expected:[详细]
2023-03-31 20:40 分类:问答is single table inheritance (STI) available when using polymorphism in mongoid?
When using STI and polymorphism in ActiveRecord, the following is needed to ensure that :dependent => :destroy[详细]
2023-03-31 17:43 分类:问答devise and STI how to login as Base class upon registration
I\'ve seen similar posts already, but couldn\'t quite get the answer I needed. I have a User model and using STI a Student model that is a type of User.[详细]
2023-03-31 14:44 分类:问答Rails app using STI -- easiest way to pull these records?
I\'m learning my way around Rails and am working on a sample app to keep track of beer recipes. I have a model called Recipe which holds the recipe name and efficiency.[详细]
2023-03-31 06:06 分类:问答Active Admin and STI model error: Could not find table 'categories'
Update #1: Solved! Somehow Pow did not restart it\'s processes, so after updates it was loading the old config files. And it was loading the wrong locale file.[详细]
2023-03-31 02:15 分类:问答Posts Model & Controller Architecture
I am trying to develop a simple site that lets users add posts and view them all in one aggregated stream.[详细]
2023-03-30 15:03 分类:问答Client side validations and STI
I am using the client_side_validations gem. How do you suggest getting this to work with STI? class Vehicle < ActiveRecord::Base[详细]
2023-03-25 18:33 分类:问答