Displaying 20 results from an estimated 7000 matches similar to: "Class Table Inheritance - ?"
2007 May 28
5
CTI in ActiveRecord
I search an plugin or gem, but don''t find nothing satisfactory. I
believe to be stranger a technology that nails the DRY, have that create
you vary equal tables, instead of using inheritance.
Exists an soluction for this? I want a solution similar to this:
create_table :people |t| do
t.column :name
t.column :address
end
create_table :customer |t| do
t.column :person_id
2005 May 01
2
Active Record and Postgres table inheritance?
Active Record doesn''t appear to have support for table inheritance implemented
in PostgreSQL as described in
http://www.postgresql.org/docs/8.0/interactive/ddl-inherit.html.
Is anyone working on such a thing or is their some compelling reason to avoid
this feature?
I am new to Ruby and Rails, but it doesn''t seem like it would be to difficult
to adapt the current Active
2007 Aug 23
6
Calling a method on class creation
I have a model User that has property called status. Status is just a
string that can only be evaluated and not persisted. I.e. it doesn''t
have a field in the user table.
Anyways, I would like a method get_status to be called anytime I
create a new instance of User. For example:
user=User.new
Since I created a new instance of User, I should now have access to
the status property, e.g.:
2007 Mar 08
2
Composite Primary Keys
Have been looking into using rails but am finding the "Composite
Primary Keys are Bad" thing a tad disturbing (to put it mildly). I
have been working with RDBMS systems for over fifteen years and this
is the first time I have herd the idea questioned. I have cone across
using surrogate keys which mirror the composite key for performance
reasons in VERY big databases but I have never
2004 Nov 19
18
SingleTableInheritance Considered Harmful
Here''s the text of a quick note I''ve added to the Inheritance wiki page.
I''m actually proposing that it would be a good idea to drop automatic
single table inheritance and force people to declare it explicitly.
There are two reasons for this:
1. Implicitly doing it unnecessarially limits your use of
inheritance where you really need it: in your object-oriented
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''
2006 Nov 13
3
Lighttpd Problems
Hi everybody,
I was using ruby with Lighttpd just fine, and all of a sudden I''m having
a problem. I''ve exhausted google - nobody else seems to have this
problem.
when running script/server, I get:
=> Booting lighttpd (use ''script/server webrick'' to force WEBrick)
=> Rails application started on http://0.0.0.0:3000
=> Call with -d to detach
=>
2005 Dec 31
1
Error when Testing AWS API (ArgumentError: illegal refid http://test.host/login)
OK, I''m finally starting to play around with the AWS part of Rails,
and I''m running into problems with the functional tests. If I use the
generator to create the web service as
./script/generate web_sevice MyTest do_it
and then run the unit tests without further editing the code, I get
the following error:
test_do_it(MyTestControllerApiTest):
ArgumentError: illegal
2006 Aug 17
1
expectations on stubs (stubba) or mock methods on existing classes?
Hello,
First, thanks for releasing Mocha. As someone who''s been practicing
TDD much longer than I''ve been using Rails, one of my biggest
complaints has always been the fact that the "Unit" tests are more
like intefration tests because of how tightly coupled the domain model
is when using ActiveRecord. Stubba looks like it could really help
aleviate this problem.
The
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
2005 Feb 09
1
[DEFECT] ''validates_inclusion_of'' not working as expected (couldn''t post to Trac as it gave me an error)
Hello,
I tried to post this as a bug on the trac site, but whenever I hit
submit, I got the error message:
---
Precondition Failed
The precondition on the request for the URL /newticket evaluated to false.
---
Anyway...
Let''s say I have the following model classes:
---
class Project < ActiveRecord::Base
has_many :tasks
end
class Task < ActiveRecord::Base
belongs_to
2012 Jun 09
3
ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'Transactions::DummyDdnlTransaction'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Pleas
Hello,
I stumble upon this error when loading a subclass of the Transaction
class. For full details, see the pastie:
http://pastie.org/4053678
Error message: ActiveRecord::SubclassNotFound: The single-table
inheritance mechanism failed to locate the subclass:
''Transactions::DummyDdnlTransaction''. This error is raised because the
column ''type'' is reserved for
2005 Dec 16
3
Productize on 1.0
Hi,
Has anybody tried using the Productize plugin on a recent Rails install?
The pages on RubyForge http://rubyforge.org/projects/productize/ seem to
indicate the development has sort of stalled, or perhaps it''s stable as
can be.
Just thought I''d ask for before I give it a go..
Cheers,
Jeroen
2005 Dec 17
2
Testing RoR
I jumped into RoR @ about 3 AM. I think I''ve got it running, but need a
simple sanity check. I''ve been through as many references as possible,
but thought that I''d ask the list here for references. This list sort of
almost being "live".
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
2009 Apr 26
2
Some extensions to class inheritance and method selection
Changes were committed today to the r-devel version of R to make S4 and
S3 classes (and abnormal object types such as "environment") work
together more consistently.
Basically, S4 classes can now contain any S3 class or object type, and
should now inherit S3 methods for these. Also, the main practical
problem with defining S3 methods for other S4 classes (namely, that S4
2011 Aug 01
3
Class inheritance or virtual resources to manage apache modules
I want to start out with an apache class that will disable all modules
except for a pre-defined list, thus establishing a baseline of active
modules.
Then as needed, other classes could enable a module that they require
that would have been disabled by the baseline state.
Its possible several classes may try to enable the same module (1 or
more classes needing module1 could be on a single node)
2006 Mar 18
1
Fixtures and single table inheritance
I''m wondering what the accepted method for doing unit tests on STI models is.
I tried to create a fixture for the class but Rails tries to load that
data into the non-existent child table. I could create a fixture named
for the real, parent table, but then it would be very difficult to
test for the individual functionality and integrity of each sub-class.
I saw this page
2012 Jun 09
0
Re: ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'Transactions::DummyDdnlTransaction'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. P
FIXED: Transaction is a reserved word, and it cannot be used even
though I put it into its own module. So my guess is
Transactions::Transaction still somehow got resolved to the Rails
internal Transaction class.
Renamed the Transaction (and its subclasses) to Transact and it works fine now.
Thanks!
-- cmdjohnson
On Sat, Jun 9, 2012 at 3:08 AM, Commander Johnson
2013 May 08
1
Namespace/inheritance problem in S4 methods for a union class
Hi,
I started this post on bioc-devel but this seems to be more general:
https://stat.ethz.ch/pipermail/bioc-devel/2013-May/004311.html
See reproducible example from Martin below.
Thank you.
Renaud
---------- Forwarded message ----------
From: Martin Morgan <mtmorgan at fhcrc.org>
Date: 7 May 2013 19:55
Subject: Re: [Bioc-devel] ExpressionSet and LumiBatch: inheritance problem
in S4
2012 Apr 30
1
question dovecot Inheritance global acl vs userfolder acl
Hi Timo
my tests resulted in
inheritance is given if a userfolder has set some acl to its new created
subfolder , which is nice
if some userfolder has its acl from global acl
there is no inheritance to its new created subfolders,
that subfolders will always created with full owner rights
i am not really sure if its a good idea
to have inheritance from global acl and
if its hackabel what is your