-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have a card-game application which makes use of Single Table Inheritance. I have a class Card, and a database table cards with column type, and a number of subclasses of Card (including class Foo < Card and class Bar < Card, for the sake of argument).
As it happens, Foo is a card from the…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
In linking a sports event to two teams, at first this seemed to make sense:
events
- id:integer
- integer:home_team_id
- integer:away_team_id
teams
- integer:id
- string:name
However I am troubled by how I would link that up in the active record model:
class Event
belongs_to :home_team…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have a table called "talk", which is defined as abstract in my schema.xml file.
It generates 4 objects (1 per classkey): Comment, Rating, Review, Checkin
It also generates TalkPeer, but I couldn't get it to generate the other 4 peers (CommentPeer, RatingPeer, ReviewPeer, CheckinPeer), so I created…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi all,
I have a table called Users (class User < ActiveRecord::Base) and a subclass/STI of it for Clients (class Client < User).
Client "filtering" works as expected, in other words Client.find(:all) works to find all the clients.
However, for users I need to filter the result to only find…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
I study about today about 2 database design inheritance approaches:
1. Single Table Inheritance
2. Class Table Inheritance
In my student opinion Single Table Inheritance make database more smaller vs other approaches because she use only 1 table.
But i read that the more favorite approach…
>>> More