similar to: assignment of parent ID in child''s fk field

Displaying 20 results from an estimated 90 matches similar to: "assignment of parent ID in child''s fk field"

2006 Oct 17
6
Session access interfers with other model access
Sorry to be such a bother but I''m not getting this. I have two models: Emrec and Session (I''m using AR for session mgmt.) In my worker I can access the Emrec model and delete a record, AS LONG AS I don''t try to access the Session model. With the Session model access commented out as below, the Emrec record gets deleted. If I uncomment those lines, the Emrec
2006 Oct 17
2
accessing args in worker
If, in the controller, I start a worker and pass in an argument like this: session[:job_key] = MiddleMan.new_worker(:class => :foo_worker, :args => {:emrec_id => @emrec.id}) How do I access the value in the worker? I can''t seem to figure it out ;-p Thanks! Bill -------------- next part -------------- An HTML attachment was
2007 Feb 20
1
error message for record not found ?
I''m using backgroundrb for session management and deletion of visitor-entered information when a session is abandoned. The visitor can either click a button to end their session and remove their data, or backgroundrb will do it for them after 5 minutes of inactivity. Everything''s working fine, I think. If the visitor explicitly logs out, then when the worker checks for their
2006 Mar 05
2
Need help understanding Rails magic!
Hi, I''ve just been pleasantly surprised, again, by how much Rails does for me, but I am *really* surprised. Surprised as in "how the heck did that happen?" I''d really like to understand this and would appreciate any help. Big picture... the user is presented with a form that allows them to select one or more check boxes to record their allergies. The form uses the
2006 May 10
2
trouble creating new records
Is it possible to create / save a new record from a controller other than the one I specified when I created the scaffolding? My situation is that I have two tables. Emrecs is the parent. Actors is the child and has a foreign key named emrec_id that references emrec.id. I scaffolded both, creating controllers and views for each. My app collects info from the user to fill in the two tables,
2006 Jun 09
8
[how can i delete a file system..please help]
Hi, I''m trying to delete a file system (<xml_26548975.xml>) File.delete("xml_26548975.xml") But I get this error: "Permission denied - ./script/../config/../uploads/xml_26548975.xml". Why? -- Cheers, ioana k&a http://boulangerie.wordpress.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 May 26
0
has_and_belongs_to_many with fk constraints?
Hi folks, I''m wondering if it''s possible to use foreign key constraints on the join tables of a has_and_belongs_to_many relation. Specifically, I get this error when I try and delete a model I''m using, named saved_search, which is many-to-many with neighborhoods. Any ideas? Thanks for any help. :-) -Eric Code: @saved_search.destroy Error: Mupdate or delete on
2006 May 28
1
ActiveRecord: FK constraints problem
Hi all. I have has_and_belongs_to_many association between models: Section and Content. class Section < ActiveRecord::Base acts_as_tree has_and_belongs_to_many :contents belongs_to :default_content, :class_name => ''Content'', :foreign_key => ''default_content_id'', :dependent => :nullify end class Content < ActiveRecord::Base belongs_to
2006 Jan 10
0
bug? : STI and :include => fk and class_name MUST be specified
I suspect this is a bug. Or a limitation. Problem: ---------------- When you include a STI class in a ''find'' : @results = Result.find :all, :include => :event , you are forced to specify the fk and the class name : belongs_to :event , :class_name => "Event", :foreign_key => "event_id" . Full code: ----------- class Event <
2006 Oct 20
0
FK references in DBDesigner4?
I seem to have trouble getting DBD4 to create ActiveRecord-compatible DDL statements. I have a database with a series of 1:n relationships which should be easy to model. But, depending on the relationship type I use, when I connect them in the ERD it either: 1) starts cascading foreign keys like an avalanche, or 2) fails to add ''contraint fk_xxx foreign key (yyy) references
2006 Aug 23
1
problems with Oracle: FK, triggers
Hi All! Is anyone working with Oracle on Rails? What about testing? I will be very happy if you can help me: 1) When I run rake test:unit it removes all my sequences in test enviroment. And I get an error like "OCIError: ORA-02289: sequence does not exist" But when I run rake db:test:clone_structure I can see all sequences again. Where is a problem? 2) How I can take proper
2007 Jan 31
0
radio buttons => What if the value is a FK?
Hi: I have radio buttons like this in my view: <%= radio_button :goals, :goaltype_id, ''Recurring'', { :onclick => "new Effect.SlideDown(''recurring''); return false;" } %>&nbsp;&nbsp;Recurring<br /> <%= radio_button :goals, :goaltype_id, ''One-time'', { :onclick => "new
2006 Mar 15
4
[NQ] How to set an initial FK for a new item of something?
Hi all, running into a little problem here. I''ve a list of things with a "New thing" link beneath it. When you click that link, obviously, a new thing shall be created. Now, that works pretty fine for things that don''t have foreign keys, but for things that do it crashes, since there is not yet a thing.other_thing.name available. I suspect you can somewhere in
2010 Jan 27
2
RMySQL - Bulk loading data and creating FK links
I have a table (contact) with several fields and it's PK is an auto increment field. I'm bulk loading data to this table from files which if successful will be about 3.5million rows (approx 16000 rows per file). However, I have a linking table (an_contact) to resolve a m:m relationship between the an and contact tables. How can I retrieve the PK's for the data bulk loaded into
2009 Oct 08
6
Eager Loading a Relationship That Has No PK/FK
I''m attempting to wrestle an old DB into Rails. This relationship is giving me trouble: class Show < AR::Base has_many :segments end class Segment < AR::Base belongs_to :show has_one :media #this has no PK/FK relation end A Segment is "linked" to Media by Media.name, which is the result of concatenating Segment.name and Segment.part. As I said there are is no
2007 Jun 09
7
create 2 fk referencing the same table
Hi everyone! I have a problem with defining 2 fk referencing the same table. I have a Program table and a Team table. The Program should have an away team and a home team fk. From my understanding, "the fk column should be named after the class of the target table, converted to lowercase, with _id appended". But, in my case, I have 2 fk referencing the same table. How can I do this?
2005 Jun 27
9
FK constraints overrated?
Hello folks, I use to think that a relational databases without foreign keys constraints enforced strictly by the RDBMS were no good, piece of crap, data junk. However, I''ve also learned the hard way that FKs constraints imposes serious difficulties when moving data around, specially between different DBs, or for loading test data or for upgrading DBs schemas, or for porting DBs
2006 Mar 09
3
Need help PLEASE!!! - updating collection from form
Greetings! I''m trying to update a set of records from the same model on one form. The AWD book gives an example on p.356 but I guess I''m not understanding it. I can see from the error message I''m getting that the controller is receiving a hash of hashes back from the view, and that it''s got the stuff I expected (two values per record that was sent to the
2006 Sep 09
2
Server-side session management for short session expirations?
I need to effectively log a user out if their session is inactive for more than a short period of time, like 5 minutes. I need some help understanding how to approach session expiration and cleanup in Rails. When the user explicitly logs out of my app, I delete all the data they''ve entered/that''s been created during their session. The data includes files, database records, and
2007 Jan 24
0
hm :through -- nonstandard fk's
+1 for http://dev.rubyonrails.org/ticket/6466 Would someone mind reviewing this one? It concerns adds and deletes on has_many :through associations that don''t use the standard foreign key naming structure. I spent an hour tracking this down before checking Trac. D''oh!