similar to: ActiveRecord - Joined subclasses possible?

Displaying 20 results from an estimated 10000 matches similar to: "ActiveRecord - Joined subclasses possible?"

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
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
2015 Jan 27
2
[LLVMdev] RFC: Introduce a section to the programmers manual about type hierarchies, polymorphism, and virtual dispatch.
The proposed addition to ProgrammersManuel.rst is below the break... This is essentially trying to explain the emerging design techniques being used in LLVM these days somewhere more accessible than the comments on a particular piece of infrastructure. It covers the "concepts-based polymorphism" that caused some confusion during initial reviews of the new pass manager as well as the
2006 Aug 15
6
Theoretical: Should models be subclasses of AR or mix it in?
All, My apologies if this is a little long-winded and stream of consciousness-y :). SUMMARY: Why do we extend ActiveRecord instead of mixing it in to our model classes? Been thinking about my app''s models and starting to want to build something of a hierarchy. I have some commonality across 3 of my model classes and I''d liek to aggregate the behavior in a superclass.
2006 Jan 02
0
Best practice for registering/discovering STI subclasses?
Folks, I''m fairly new to Rails, and I''ve Googled around for an answer to this question with no luck... Consider a little blog application that has uses single-table inheritance for the handful of different content types via a Content base class and subclasses like FooContent and BarContent. That part all works well for me. Now consider the view that presents actions to the
2006 Jan 09
0
Problem with publishing subclasses by AWS API specification
Hi, I''m quite new to Rails and have a problem with the use of AWS. The Problem is, that I have a class which provides some basic attributes and some subclasses of this with more specific attributes. I want to send objects of those classes through SOAP by a remote client, but if I specify just the base class in the method signature of my API definition the generated WSDL file will
2006 Jan 11
0
HELP!! - Problem with AWS and subclasses
Hi, I''m quite new to Rails and have a problem with the use of AWS. The Problem is, that I have a class which provides some basic attributes and some subclasses of this with more specific attributes. I want to send objects of those classes through SOAP by a remote client, but if I specify just the base class in the method signature of my API definition the generated WSDL file will just
2011 Jul 14
0
subclasses with inherited_resources?
I''m trying out inherited_resources and so far so good. However, one problem I''ve run into is that it''s very difficult to customize inherited_resource behaviour in subclasses. Looking through the source I see it uses things like undef_method and class_attribute. For example, if I have the following controllers: class ItemsController inherit_resources actions :new,
2007 Dec 01
6
Building files from snippets
Hi there, I''m facing a problem that I think it''s common enough to be solved directly by puppet or at least have a best practice recommended: building a config file from snippets. I''m thinking for example about a dns zone and hosts inside that zone, ldap server and ldap databases, samba server and samba shares, a firewall config and firewall rules,... The first part of
2008 Oct 06
2
Filter inheritance
can anyone tell me how before filter can call the private method audit which from the parent class ? because the bank controller has a private method called audit, this one should not be inheritance by VaultController, so how the before_filter use the private method audit ? if the child class can use the parent class private method . does it break encapsulation ? does the private has any sense
2006 Mar 01
4
STI, subclasses and callbacks
I have a STI class tree. I want to set some default values (calculated values so I can''t set it in the database as defaults) on every created instance regardless of what subclass is actually instantiated. So I figured adding a after_create callback in the top class in the hierarchy should do the trick. It seems it doesn''t get called :( Code: class SuperClass <
2006 Aug 15
0
ActiveRecord inheritance with types table
I have a Field class: class Field < ActiveRecord::Base belongs_to :field_type end with it''s table: fields: id field_type_id name ordering every field has a type class FieldType < ActiveRecord::Base end stored in the field_types table field_types: id name class_name for each field type, there''s a subclass of Field that do whatever special
2007 Mar 28
4
Disabling ActiveRecord "type" column subclassing
Hi! I have a legacy table that has a column named "type" and need to remove this automatic subclassing by ActiveRecord. The api pages are vague about this, and I tried self.inheritance_column = "xtype" which seemed to get me half-way. In the validate_on_create method, the value of self.type was my model Class name. How would you disable this feature? -- Posted via
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
2009 Oct 05
0
ActiveRecord Polymorphic Inheritance
I am using RoR ActiveRecord polymorphic inheritance and was wondering if it''s possible to access the base class'' association methods in the invocation of either to_xml or to_json without having to depict the base class data in the serialized string. Here are my classes: # base class class Asset < ActiveRecord::Base belongs_to :resource, :polymorphic => true
2006 Jan 19
3
Why does Object.subclasses_of ignore subclasses within modules?
ActiveSupport provides a method Object.subclasses_of, shown below: def subclasses_of(*superclasses) subclasses = [] ObjectSpace.each_object(Class) do |k| next if (k.ancestors & superclasses).empty? || superclasses.include?(k) || k.to_s.include?("::") || subclasses.include?(k) subclasses << k end subclasses end Can anyone shine some light on why
2010 Jan 26
6
Subclassing ActiveRecord::Base
First of all, sorry for the crossposting, but I put this into the Ruby Forum first of all, but was pointed to this as a more appropriate location. I''m using ActiveRecord and ActiveSupport in a non-rails environment to connect to multiple databases, and I''ve found the following (single database) to cause me an error. Note that params is my database settings and omitted for
2011 May 30
1
Query super- and subclasses of a class: is there a better way than to use 'completeClassDefinition()'
Dear List, when I first started to use S4 classes, I used the function 'completeClassDef()' in order to see the super- and subclasses of a certain class: setClass(Class="A", representation=list(a="numeric")) setClass(Class="B", contains="A", representation=list(b="character")) # Super x <- completeClassDefinition("B")
2012 Mar 13
2
Definition of generic function for subclasses
Hi, I am working on a project, which contains S4 classes and subclasses. Lets assume the following organisation: A: S4 Class B,C: inherit from A D,E,F,G: inherit from B H,I: inherit from C I want to define now a generic function, which returns me the name of the class. I can now write the function with "A" in the signature. Is there any reason to write the function for B,C, D,E,... with
2011 Oct 18
0
[LLVMdev] Question about MCExpr and subclasses
That just means the ELF writer doesn't know yet how to deal with the target-specific data. It needs taught how to map them onto relocations and such. Do you really need to subclass MCTargetExpr? That's ordinarily only for operands that aren't representable via the normal MC stuff (for example, the ARM movw/movt relocations). You should be able represent normal symbol operands w/o