Say I have an STI relationship, where Commentable is the super class, and NewsComment is the subclass.In Commentable I have:
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\',
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\".
On Rails 3.1 RC6, given class Animal < ActiveRecord::Base default_scope where(legs: 4) end The following does not work as expected:
When using STI and polymorphism in ActiveRecord, the following is needed to ensure that :dependent => :destroy
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.
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.
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.
I am trying to develop a simple site that lets users add posts and view them all in one aggregated stream.
I am using the client_side_validations gem. How do you suggest getting this to work with STI? class Vehicle < ActiveRecord::Base