Apologies if this is ridiculously straightforward - my learning-curve
is near vertical and I've got a bit lost on the Hobo/Rails cliff-face
(but enjoying it). Thanks in advance to any suggestions.

I have a very simple patient database with a lifecycle which holds
whether the patient is admitted or discharged -  this is working
wonderfully using TablePlus and <transition-buttons/>.

However, I want to  'blank-out' (set to nil probably) the location
when a patient is discharged.

My question is how best to do this.

Any help gratefully received. Many thanks

DJ

__________________________

Relevant code in patient.rb is as follows:


class Patient < ActiveRecord::Base

  hobo_model # Don't put anything above this

  fields do
    first_name                     :string
    last_name                      :string
   # etc - field-list cut for clarity ...
    timestamps
  end

  belongs_to :location
 # etc - other relationships cut for clarity

  lifecycle :state_field => :admission_status do

    state  :admitted
    state  :discharged ,  :default => true


    transition  :admit_patient, { :discharged => :admitted } , :params
=> [ :location ] ,
                :available_to => :all do

    end

    transition  :disharge_patient, { :admitted => :discharged },
                :available_to => :all do

    end

  end

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to