similar to: subclasses_of - why does it ignore subclasses within modules?

Displaying 20 results from an estimated 20000 matches similar to: "subclasses_of - why does it ignore subclasses within modules?"

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
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
2011 Oct 19
0
[LLVMdev] Question about MCExpr and subclasses
HI Akira, Please include the mailing list on replies. Using an MCExpr is the right way to build up things like symbol+offset. ARM has examples for that, as well, which may prove useful. For printing, the target libraries can do that however they want, including using the generic print method for expressions (or not). Often, the generic printing is sufficient, but not always. You can register a
2010 Oct 20
2
new.env does not recognize parents from subclasses of "environment"
Dear Developers, A lot has been changed in the R12.0 with respect to behavior of "environment" subclasses. Many thanks for that. One small irregularity, though; new.env does not allow the parent to be from S4 subclass. > setClass("myenv", contains="environment") [1] "myenv" > new.env(parent=new("myenv")) Error in new.env(parent =
2011 Oct 18
4
[LLVMdev] Question about MCExpr and subclasses
I have a question about MCExpr and its subclasses defined in MCExpr.h. I am trying to get Mips' direct object emission working. Line 283 of MCElfStreamer.cpp reads like this: 00283 case MCExpr::Target: llvm_unreachable("Can't handle target exprs yet!"); Does this mean that if I use a subclass of MCTargetExpr to lower MachineOperands to MCOperands, it won't work?
2007 Feb 18
1
namespaces in subclasses
I have several modules that I store in rails_root/lib and that are used by my controllers. I''m having a problem accessing AR objects from inside a class that is a subclass. I keep getting a NameError when trying to do something like Foo.find(), where Foo is an AR object. uninitialized constant OpenTransact::Gateway::Request::CreditCardCharge::PaymentAccount (NameError) For some reason
2006 Apr 22
4
Slice and dice plugin
I''ve been playing around with some easier ways of specifying conditions in active record, and have come up with a little plugin that some may find useful. Currently active record finder and calculations methods can take a :conditions option with a string or array listing some sql conditions, eg: Animals.find :first, :conditions => "name = ''Tiger''" My
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
2006 Jul 06
5
Single table inheritance
I''m having a class called Person, with subclasses as goalkeeper, forward, defender. Now a person can be a forward as well as a defender or a goalkeeper. I want to use single table inheritance like : class Goalkeepr < Person end And not have multiple boolean columns like in my people table like is is_goalkpeer, is_forward, is_defender. How do I go about it ? Thanks, Pratik -- rm
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.
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
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")
2015 Oct 08
2
llvm:cl::parser subclasses final in 3.7?
All, I'm upgrading some code that uses LLVM from 3.6 to 3.7. It looks like the llvm::cl::parser subclasses are now final? We had been doing: struct MaxThreadsParser : public llvm::cl::parser<unsigned> { bool parse(llvm::cl::Option &O, llvm::StringRef ArgName, llvm::StringRef Arg, unsigned &Val); }; But that's now causing: In file included from
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 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 Sep 25
3
Subclasses - help required
Hello all and hoping for some insight a project manger type of application, staff are assigned to projects, but each staff has varied roles for different projects... STI does not seem to be applicable here Imagine a table staffs... id int name varchar blah.... is_manager int 1 is_engineer int 1 is_producer int 1 and projects... id name manager_id engineer_id producer_id how is the best way
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
2009 Aug 26
2
counting subgroup sums within a data frame
Hi, I'm sure there's an easy approach to this issue, I'm just not seeing it. I have a data frame of the following form: Date class subclass count 8/1/2009 A X 1 8/1/2009 B X 2 8/1/2009 A Y 9 8/1/2009 B Y 3 8/2/2009 A X 1 8/2/2009 B X 5 8/2/2009 A Y
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