Module: Renalware::Accountable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Renalware::Accesses::Assessment, Renalware::Accesses::Plan, Renalware::Accesses::Procedure, Renalware::Accesses::Profile, Renalware::Admissions::Admission, Renalware::Admissions::Consult, Renalware::Admissions::Request, Clinical::Allergy, Clinical::BodyComposition, Clinical::DryWeight, Clinics::ClinicVisit, Directory::Person, Events::Event, Feeds::File, HD::Diary, HD::DiarySlot, HD::PreferenceSet, HD::PrescriptionAdministration, HD::Profile, HD::Session, HD::Station, Letters::Archive, Letters::Letter, LowClearance::Profile, Medications::Prescription, Medications::PrescriptionTermination, Modalities::Modality, PD::Assessment, PD::PETAdequacyResult, PD::RegimeTermination, PD::TrainingSession, Pathology::Requests::Request, Patient, Patients::Alert, Patients::Worry, Problems::Note, Problems::Problem, Renal::AKIAlert, Research::Study, Research::StudyParticipant, Transplants::DonorStage, Transplants::RecipientWorkup, Transplants::RegistrationStatus, Virology::Profile
- Defined in:
- app/models/concerns/renalware/accountable.rb
Overview
Responsible for assigning a system user to the record when it is created and updated.
Instance Method Summary collapse
- #first_or_create_by!(user) ⇒ Object
- #save_by(user) ⇒ Object
- #save_by!(user) ⇒ Object
- #update_by(user, attrs) ⇒ Object
Instance Method Details
#first_or_create_by!(user) ⇒ Object
47 48 49 50 |
# File 'app/models/concerns/renalware/accountable.rb', line 47 def first_or_create_by!(user) self.by = user first_or_create_by! end |
#save_by(user) ⇒ Object
37 38 39 40 |
# File 'app/models/concerns/renalware/accountable.rb', line 37 def save_by(user) self.by = user save end |
#save_by!(user) ⇒ Object
32 33 34 35 |
# File 'app/models/concerns/renalware/accountable.rb', line 32 def save_by!(user) self.by = user save! end |
#update_by(user, attrs) ⇒ Object
42 43 44 45 |
# File 'app/models/concerns/renalware/accountable.rb', line 42 def update_by(user, attrs) self.by = user update(attrs) end |