similar to: How to access attributes from a join table?

Displaying 20 results from an estimated 8000 matches similar to: "How to access attributes from a join table?"

2006 Mar 19
1
How to access atributes from a join table?
I have a table "domains", "users" and a join table of "domains_users" which has the domain_id, user_id as well as a userlevel_id attribute. I know that in the model User class I can set the value of this attribute with a function that calls: domains.push_with_attributes(domain, :userlevel => 1) but how do I access the userlevel field so that I can use it later
2006 Jan 04
2
Updating Attributes in a HABTM Join Table
Is there a way to update attributes in a HABTM join table? Right now I am deleting the join and then recreating it with new attributes. I have a table "categories" and another table "items". They are both HABTM with the join table "categories_items" between them. If an item is joined to a category once, no problem, we create the join. But if an item is
2005 Mar 08
1
Updating Join Attributes
Other than doing a raw SQL update the only way to update join attributes is to remove an object and then push_with_attributes correct? -- Lon
2006 Mar 01
6
How to retrieve attributes from HABTM?
We have tables Users and Communities linked by has_an_belongs_to_many. The join table Communities_Users has additional fields [ is_active, is_blocked, join_date] etc. These are populated using @user.push_with_attributes(:is_active => true,...). Later on how do we update or retrieve the attributes in the link table for a given user or a community with doing it explicitly using SQL? Thanks,
2006 Apr 29
5
HABTM - how to insert join row when associated rows exist
I have successfully used HABTM to create a many-to-one-to-many set of rows in one step. Now, if two objects I want to associate already exist, how do I create the join row? The Agile book mentions the ''push_with_attributes'' method. The text says this method is useful for adding additional attributes to the join row (in the example a ''read_at'' timestamp). I
2006 May 08
3
operator overload on views
In my User auth scheme I have a userlevel. I''ve overloaded the User class operators like this: def >(item) if item.class == "User" self.userlevel > item.userlevel else self.userlevel > item end end (other operators are overloaded in essentially the same way). As I understand it, using the operator ">" inside the overloaded
2006 Jan 04
0
Re: DB Modelling the Rails way - solution by Chris Hall
Hi Chris, Yesterday you kindly submitted an answer to my question on modelling many to many relationships. I''ve briefly tried the proposed solution but so far with no luck. Before I get too involved - I''d like to know if mapping three way :join_tables is "legal" in a Rails sense. I only ask since you put (untested) in your mail and I can''t find any docs on
2006 Jan 07
4
To Chris Hall - Re: DB Modelling the Rails way - Opinions??
Chris, Finally got time to fully play with your suggestions. Had to re-code a bit of stuff but the concept works - just like a bought one :~). Many thanks for the solution, Kind Regards, Eric. For those curious - here''s what it was about; On Monday 02 January 2006 02:10, Eric Sloane tried to type something like: > Hi, > I''m trying to figure the most efficient way to
2006 Apr 23
0
Severe STI, HABTM with Attributes and 1.1
All, I had been working on a project that was using STI to a very high degree. It also was using a HABTM table that had a couple extra attributes. It seems that with 1.1 push_with_attributes is deprecated and I am having a bit of trouble moving things to using has_many :through The original schema I had worked like this : create_table "nodes" do |t| t.column "title",
2005 Nov 16
1
HABTM: deleting records based on attributes
Hello All, I am new to ROR, and can''t seem to get HABTM to cooperate entirely... however I might be abusing it! Before I try a different strategy I thought I''d ask here and see if I''m missing something simple. So say Projects and Companies are related. Projects can have multiple Companies, and Companies can be on multiple Projects. But, the same Company can also
2006 Apr 27
1
issue with deprecatiing push_with_attributes
I''ve been listening to the discussions regarding the plans to eliminate push_with_attributes. While I think it''s good practice to make join models if you''re developing a new system, I can''t help but think t hat push_with_attributes should be left around to deal with legacy databases. I might want to wrap my application around a database I don''t
2006 Mar 15
1
push_with_attributes not inserting default values
I have a join table A_B with columns[a_id, b_id, c_data default 1, d_data default 1]. If I do: @aobj.bobjs.push_with_attributes(@bobj,{:c_data => 0}) I find that the row inserted, has d_data set to 0 and not the default value specified in the database, which is 1. So I am having to explicitly set it using : @aobj.bobjs.push_with_attributes(@bobj,{:c_data => 0, :d_data => 1}). Is this
2005 Mar 13
1
Semantics of push_with_attributes
In trying to add timestamp support to habtm, I''ve stumped on a question which I hope you all help me solve. And that is, when adding a record twice to the list of associations with push with attributes, should the following test succeed or not? def test_pushing_twice dev = Devel.new("name"=>"victor") p =
2006 Jul 31
1
Use of push_with_attributes
Hi, I have a model class called Page and a corresponding pages table in the db. Is there a way to do Page.new without actually creating a corresponding record in the table? I want to set some values in it and then pass it to the add_content_component() method in the class below which calls push_with_attributes() which will actually create the record in the db? class Page <
2007 Dec 10
0
[PATCH] avoid duplication of domain ID in messages
text doesn''t need to repeat that. Signed-off-by: Jan Beulich <jbeulich@novell.com> Index: 2007-12-10/xen/arch/x86/hvm/hvm.c =================================================================== --- 2007-12-10.orig/xen/arch/x86/hvm/hvm.c 2007-12-10 09:19:12.000000000 +0100 +++ 2007-12-10/xen/arch/x86/hvm/hvm.c 2007-12-10 09:22:53.000000000 +0100 @@ -533,8 +533,7 @@ static void
2007 Dec 27
2
VT-d and the GPU
Like others on this list I am trying to employ the VTD-NEO patches in Xen 3.2 unstable to assign the internal graphics device to Dom1/Vista. I have removed the Cirrus Logic emulated device from qemu and replaced the Cirrus Logic vgabios with the the actual vgabios from my GPU. However I am hitting an xen assert and was hoping someone might be able to point me in the right direction. Below
2012 Apr 24
1
[PATCH] [resend] xen-access: Check return values and clean up on errors during init
Check the return values of the libxc mem_access calls. Free allocated structures (platform_info, domain_info) on errors during initialization and exit. Unbind VIRQ, close event channel and connection to Xen on errors during initialization Signed-off-by: Aravindh Puthiyaparambil <aravindh@virtuata.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> diff -r ea47068fa7a2 -r
2007 May 29
0
Fw: [RFC] makedumpfile: xen extraction
Hi, I sent the following e-mail to kexec-mailing list (kexec@lists.infradead.org) since subjects of makedumpfile are discussed on the mailing list. I want to inform this to xen developers since I think this function is useful for xen developers. Thanks. Itsuro Oda (see https://sourceforge.net/projects/makedumpfile/ about makedumpfile command.) Forwarded by Itsuro ODA
2011 Dec 20
0
sedf: remove useless tracing printk and harmonize comments style.
sched_sedf.c used o have its own mechanism for producing tracing-alike kind of information (domain block, wakeup, etc.). Nowadays, with an even not so high number of pCPUs/vCPUs, just trying to enable this makes the serial console completely unusable, produces tons of very hard to parse and interpreet logging and can easily livelock Dom0. Moreover, pretty much the same result this is struggling to
2006 May 06
3
Storing additional data on join tables with Rails
Hi there I need to store additional attributes on join table. Searching the Wiki [1] revealed two possible methods: 1) push_with_attributes, as described by Justin Palmer [2]. Unfortunately, "this method is now deprecated" [3]. Even if it wasn''t, there seem to be inherent problems with that approach, for example with updating those additional attributes, though Joshua Muheim