Displaying 9 results from an estimated 9 matches for "emrec_id".
2006 Oct 17
6
Session access interfers with other model access
...mment those lines,
the Emrec record is _not_ deleted. Any idea what I''m doing wrong?
Thanks,
Bill
In my controller...
@session_id = session.session_id
session[:job_key] = MiddleMan.new_worker(:class => :foo_worker,
:args => {:emrec_id =>
@emrec.id,
:session_id =>
@session_id})
In my worker...
def do_work(args)
@time_remaining = 7
@emrec_id = args[:emrec_id]
#@session_rec = Session.find(:first,
# :conditions => ["...
2007 Feb 20
1
error message for record not found ?
...stantRails-1.3/ruby/lib/ruby/1.8/drb/drb.rb:1624:in `start_service''
script/backgroundrb/start:108
------------ Worker code ----------
class SessionWorker < BackgrounDRb::Rails
attr_reader :time_remaining
def do_work(args)
@time_remaining = args[:initial_setting].to_i
@emrec_id = args[:emrec_id]
@session_id = args[:session_id]
@session_rec = Session.find(:first,
:conditions => ["sessid = ?", @session_id])
watch_session(args)
sleep(2)
clean_up
end
def watch_session(args)
while @time_remaining...
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 scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20061017/48549ab5/attachment.html
2006 Mar 05
2
Need help understanding Rails magic!
...iated allergy record
# I assumed the code below would destroy *all* the allergy records. In fact, it only destroys the
# ones that had been deselected. How the heck is THAT happening ?!?!?!?
######
@allergy_list = Allergy.find(:all,
:conditions => ["emrec_id = ?", @emrec.id])
@allergy_list.each do |allergy|
allergy.destroy
end
######
# now add any new items. the model as a
# validate_uniqueness_of condition on description
# to avoid duplicate records
######
@allergy_item.update_attributes(params[:al...
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, then writes the info collected out in an XML file.
Now I need to read in the XML file and put the data back into the tables.
Any suggestions? Righ...
2006 Mar 11
2
assignment of parent ID in child''s fk field
When I create a child record I''m not automagically getting the parent ID put into the fk field. Does object.new take parameters that allows me to do that as part of the AR record creation? Or do I need to do it separately? Or am I missing the boat altogether ;-)
Thanks,
Bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
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 Mar 09
3
Need help PLEASE!!! - updating collection from form
...Thanks in advance for any assistance!
Bill
--------------------- controller code ------------------------
def edit_illnesses
# send a collection of records to the view
@emrec = find_emrec
@illnesses = Illness.find(:all,
:conditions => ["emrec_id = ?", @emrec.id])
end
def update_illness
# update the records sent in ''edit_illnesses'' based on what''s returned in ''params''
@emrec = find_emrec
@illnesses = Illness.find(:all,
:conditions => [&q...
2006 Sep 09
2
Server-side session management for short session expirations?
...entered/that''s been created during their session. The data includes files, database records, and then their session data. The controller code that gets executed when they log out is:
def cleanup
emrec = find_emrec
files = Tempfilerec.find(:all,
:conditions => ["emrec_id = ?", emrec.id])
files.each {|file|
#FileUtils.rm "#{RAILS_ROOT}/public/#{file.filename}" for production
FileUtils.rm "public/#{file.filename}"
}
emrec.destroy
reset_session
end
I need to execute the same functionality when their session times...