Class: PrescriptionPreference
- Inherits:
-
Common::Base
- Object
- Common::Base
- PrescriptionPreference
- Includes:
- ActiveModel::Validations
- Defined in:
- app/models/prescription_preference.rb
Overview
@return [Boolean]
Instance Attribute Summary
Attributes inherited from Common::Base
Instance Method Summary collapse
-
#id ⇒ String
Compute a hex-formatted digest of the attributes to be used as an ID.
-
#mhv_params ⇒ Hash
Build the object for MHV.
Methods inherited from Common::Base
#changed, #changed?, #changes, default_sort, filterable_attributes, #initialize, max_per_page, per_page, sortable_attributes
Constructor Details
This class inherits a constructor from Common::Base
Instance Method Details
#id ⇒ String
Compute a hex-formatted digest of the attributes to be used as an ID
44 45 46 |
# File 'app/models/prescription_preference.rb', line 44 def id Digest::SHA256.hexdigest(instance_variable_get(:@original_attributes).to_json) end |
#mhv_params ⇒ Hash
Build the object for MHV
33 34 35 36 37 |
# File 'app/models/prescription_preference.rb', line 33 def mhv_params raise Common::Exceptions::ValidationErrors, self unless valid? { email_address:, rx_flag: } end |