similar to: Polymorphism, acts_as_relation gem and nested attributes

Displaying 20 results from an estimated 90 matches similar to: "Polymorphism, acts_as_relation gem and nested attributes"

2006 Apr 04
4
Aggregating two objects of the same type
I would like to have a customer that has references to two addresses, a billing address and a shipping address. In a non-rails environment I would have two keys in the customers table, billing_address_id and shipping_address_id to reference the addresses. It appears that ActiveRecord expects the parent id to reside in the child table, regardless of whether the relationship is one-to-one or
2007 Jun 14
1
using 'socat' to relay Dovecot SASL's auth socket over TCP?
hi, i've been running Exim & Dovecot together on the same box. Exim's been sharing Dovecot/SASL auth info over a local unix socket. works great. i'm now splitting Exim & Dovecot onto two different boxes. iiuc, Dovecot ONLY provides a UNIX (local) socket; *not* a TCP socket for over-the-network access. SUre, I could mount the Dovecot socket's volume over NFS ... but
2006 Apr 08
2
one-to-one relationship confusion
Hello, I posted a similar email, earlier in the week, but I still must not be getting it. I have a customer that aggregates two addresses; a shipping address and a billing address. Addresses can also be referenced by other objects in a similar way, so I would really like to avoid putting the keys referencing the customer or other objects in the addresses table. Addresses are exclusively
2012 Feb 14
4
What I'm doing wrong, has_and_belong_to_many
Hello, I''m trying to insert into my migrate but when I try on rails console this error shows: 1.9.3-p0 :001 > group = Group.new => #<Group id: nil, name: nil, description: nil, created_at: nil, updated_at: nil> 1.9.3-p0 :002 > group.name = "Group Name" => "Group Name" 1.9.3-p0 :003 > group.description = "Description" =>
2006 Mar 08
0
combining STI + polymorphism + rich self HABTM : how to ?
Hi all, I need to model simple typed polymorphic relations: ''John'' [''works_for''] ''Bill'' ''John'' [''speaks_for''] ''Microsoft'' ''Microsoft'' [''hold_shares_of''] ''Apple'' I''m having a hard time combining : - S.T.I.
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
2005 Dec 27
0
acts_as_tree, polymorphism and class loading problems
I have a tree (acts_as_tree) with nodes where each node is instances of different subclasses of Node. Each Node subclass knows how to point to another table/instance in order to accomplish extension by composition. This works good most of the time where I either loops over just the nodes without accessing the "external" data (the instance pointed to by Node subclass) or just
2006 Mar 02
1
Fixture accessors broken for polymorphism, in need of redesign
Ticket 4052 (http://dev.rubyonrails.org/ticket/4052) just came through trac, which introduces the need for a better way to access fixtures. I believe the basic problem is the same as 3935 (http://dev.rubyonrails.org/ticket/3935) in that the accessor method which is constructed by the fixture call can''t infer the class name from the table name. The band-aid in 3935 was to allow you to
2012 Mar 22
1
why doesn't .where() honor polymorphism?
I love the query interface (ActiveMethod::QueryMethods), but one thing has bugged me: why doesn''t it generate calls for polymorphic associations? For example: class MyModel < ActiveRecord::Base belongs_to :parent, :polymorphic => true end I would expect: MyModel.where(:parent => a) to be equivalent to: MyModel.where("my_models.parent_id = ? AND
2008 Nov 29
0
calendar with different types of event - polymorphism
Hi all, I have a calendar. The calendar has different kinds of events. Each event type has additional information so i think i need a new model for each new event type. eg: a game event has additional oponent and oponents colors info. Is this best solved via polymorphism where I create an eventable interface? Thanks Stijn --~--~---------~--~----~------------~-------~--~----~ You received this
2006 Nov 04
0
[PATCH] #6040 STI and Polymorphism docs
Hi, I have had several emails from people thanking me for the following documention patch. http://dev.rubyonrails.org/ticket/6040 Any chance this could be commited so more people can find it? Peter
2007 Jul 16
0
100% polymorphism problem, hmm not so sure.
I have a problem to break down and implement. At first look it seems, as if it should be done in polymorphic way. I imagine it as having this "abstract" class model Thing and then many many many different concrete_thing_types. My doubt is though - I am not really able to tell now what and how many of those different concrete_thing_types there will be. There may be "hundreds"
2009 Feb 18
0
[LLVMdev] Parametric polymorphism
>> How difficult would it be to add such a capability to llvm? I was thinking >> of marking type variables like T as opaque types for the initial codegen, >> and then writing a custom pass that instantiates them to real types. >> However, I don't know if that would confuse or break other parts of the >> compiler infrastructure; parametric polymorphism is not
2009 Feb 18
0
[LLVMdev] Parametric polymorphism
On 2009-02-18, at 14:53, DeLesley Hutchins wrote: > On 2009-02-18, at 08:06, Gordon Henriksen wrote: > >> Still, there are a large number of potential foibles here. For >> instance, passing an argument can require platform-specific >> contortions to conform to the platform ABI... > > Are those contortions done by the native code generator back-end, or > are
2009 Feb 18
0
[LLVMdev] Parametric polymorphism
On Wednesday 18 February 2009 21:27:21 DeLesley Hutchins wrote: > Try implementing a generic complex number class in Java, and watch the > two-order-of-magnitude drop in performance on scientific code. Amen. I haven't proven it with a working HLVM yet but I believe LLVM will make it possible (even easy?) to generate extremely performant code from heavily abstracted high-level source.
2009 Feb 19
0
[LLVMdev] Parametric polymorphism
On Wednesday 18 February 2009 23:36:27 DeLesley Hutchins wrote: > > Why do you say that people who compile, e.g., functional languages > > would benefit from type variables in LLVM? > > I like the level the LLVM is at, and would prefer to deal with > > instantiating parametric polymorphism at a higher level. > > I'm surprised you're happy with a
2009 Feb 19
2
[LLVMdev] Parametric polymorphism
> The same can be said of closures, garbage collection and a dozen other > features that also cannot feasibly be added to LLVM. > > The only logical solution is to build a HLVM on top of LLVM and share that > between these high-level language implementations. This is an excellent point. You have convinced me. :-) BTW, what garbage collector are you using for your HLVM? You
2009 Feb 19
0
[LLVMdev] Parametric polymorphism
On Thursday 19 February 2009 03:31:04 DeLesley Hutchins wrote: > > The same can be said of closures, garbage collection and a dozen other > > features that also cannot feasibly be added to LLVM. > > > > The only logical solution is to build a HLVM on top of LLVM and share > > that between these high-level language implementations. > > This is an excellent point.
2009 Feb 19
2
[LLVMdev] Parametric polymorphism
Hi Jon, Jon Harrop wrote: > Other people are creating far more bleeding edge VMs (e.g. VMKit) using LLVM's > GC API so they would be much better positioned to discuss the technical > aspects than I am. I would like to hear any status updates they have! > > VMKit uses conservative GCs (Boehm or Mmap2, a GC developed in our lab), so we don't use the GC API. But we are
2009 Feb 19
0
[LLVMdev] VMKit (was Parametric polymorphism)
On Thursday 19 February 2009 13:39:24 Nicolas Geoffray wrote: > Jon Harrop wrote: > > Other people are creating far more bleeding edge VMs (e.g. VMKit) using > > LLVM's GC API so they would be much better positioned to discuss the > > technical aspects than I am. I would like to hear any status updates they > > have! > > VMKit uses conservative GCs (Boehm or