Displaying 14 results from an estimated 14 matches for "singletableinheritance".
2006 Jun 05
2
Class Table Inheritance implementation
I know that Rails uses the Single-Table Inheritance as mentioned in the
wiki (http://wiki.rubyonrails.com/rails/pages/SingleTableInheritance). I
was wondering if there was an easy way of implementing Class Table
Inheritance easily (one table per class) as defined in
http://www.martinfowler.com/eaaCatalog/classTableInheritance.html.
The model that I am used to is Class Table Inheritance, and for some
uses it just feels more elegant...
2006 Mar 14
4
Two Customer Types - Best Design Principle?
Hi all,
I''ll do my best to explain this... I have the possibility to have two
customer types in my system:
1. A "mailing list" type: new records are saved when user enters email
address in the mailing list subscription form.
2. A "full" type: new records are saved when the user buys something and
provides all their billing/shipping details, etc.
Model:
-
2004 Nov 19
18
SingleTableInheritance Considered Harmful
...I had no ''type'' column in my table.)
2. It''s entirely non-relational, and thus bad practice to suggest
to those who do not well understand relational DBMSes (which is the
vast majority of programmers out there) that this is any sort of a
valid technique. SingleTableInheritance is a tool of desperation,
when you can''t change your database schema to be relationally sound
and make sense.
It would in fact be nice if ActiveRecord provided support for class
table inheritance.
cjs
--
Curt Sampson <cjs-gHs2Wiolu3leoWH0uzbU5w@public.gmane.org> +81 90...
2006 Apr 14
5
One Controller, Many models
Hello all,
I am working on a app right now that is going to replace a paper form
process out client has. This process has quite a few forms (about 30)
and different groups of forms (section) need to be filled out based on
what information is required from the user. For example, here is a
possible process of 2 users:
user 1 user 2
Section 1 Section 1
Section 2 Section 2
2006 Mar 22
1
How do you clean up this cryptic code?
So, I''m coding my school project in Rails.
There are two models, User and Restaurants.
I noticed that in Restaurants, when you use the belongs_to method, you
could specify the condition of the associated table. There are a few
types of users, in the user_type column of the users table - owners is
type 1, users are type 2.
So in my haste to hand in enough code, in the Restaurant model,
2006 Mar 27
1
polymorphism + inheritance
Hi,
currently I do some work with polymorphic associations in egde rails
class Order < ActiveRecord::Base
belongs_to :payment, :polymorphic => true
end
class CreditCardPayment < Payment
end
class PayPalPayment < Payment
end
class Payment < ActiveRecord::Base
has_one :order, :as => :payment
# common stuff in here
end
I want to use [Payment] for common functionality
2006 Apr 13
2
One model won''t work like the others, generating weird error
I''ve been banging my head against this for quite some time and can''t
figure out what is going on. I''m doing up a web site based on Typo and
adding in some custom controllers. I''m running Typo from trunk, so it''s
using the version of rails in vendor/rails. Everything is going
smoothly...until now.
I have one model that JUST. WON''T. WORK.
2006 Jan 17
10
Is STI the only way to do inheritance?
I''m currently coding a system which must store multiple contact methods for
a user (phone, email, postal address etc). I''m planning a fairly
straightforward inheritance hierachy for these, where each different method
inherits from something like a ContactMethod class.
The only mention of ActiveRecord support for inheritance I can find in the
Wiki and the Agile Web Dev book is
2009 Jun 29
3
Table Inheritance based on a function
Hello,
we have a problem in a CMS project that we believe is basic for RoR
developement and could concern others as well - or have already:
RoR implements the ''Single Table Inheritance'' (STI) Pattern:
http://www.martinfowler.com/eaaCatalog/singleTableInheritance.html
.. through its ''ActiveRecord'' ORM.
The Fowler example mentions a ''type'' column and RoR implements this
directly - which we consider inconsistent with DB abastraction:
It forces a ''type'' column in the database following the application -
in...
2006 Feb 20
6
LoginGenerator - multiple user types...
I have been looking at the LoginGenerator gem. Looks great and can be
easily modified. However in my app I have two places where people can
login, one is for in my case "employees" the other is for "users". They
are seperate tables in my database and have many different fields.
I have an admin area located at ./sysadmin/ where only "employees" can
login, they
2007 Oct 04
12
Rails' abilities fitting?
Hi,
I''m looking at developing a reasonably complex web application, where
most of the complexity actually lays in the database and the queries
I need run on it. Some "classes" or models need to consist of an
assembly of several tables. It would be trivial enough for me to code
these queries in SQL, but as far as I understand Rails is trying to
hide the database as
2006 Jan 14
11
nuby: do models have to inherit directly from ActiveRecord?
Hello,
I have a few models -- book, cd, dvd -- for which I''d like to have an
abstract base superclass to hold some common stuff. That abstract class, I
was thinking, would inherit from ActiveRecord.
Didn''t work, though, and looking around, I found this:
<http://wiki.rubyonrails.com/rails/pages/HowtoMakeAbstractModel>
2006 Jul 02
10
Use Rails or PHP?
I''m new to RoR and have used PHP. I want to develop a personal
organizer that allows me to add lists (tables) and search them. The
ActiveRecord concept seems to allow me to set up something that works
with an existing table, but I want the ability to add tables without
programming. I know how to do this in PHP and I can put the SQL into
queries in RoR, but does ActiveRecord let
2006 Jan 25
12
DRY in Models
I am building an app right now that needs to grant access to three
levels of members right now - each will have their own table in the DB.
When creating the add_user action I am converting the password into a
hashed password through the model.
The way I am doing this right now, I will inevitably end up with
repeated code in three different models. Is there a way I can define
this code in