Module: Vet360::Writeable
- Extended by:
- ActiveSupport::Concern
- Included in:
- V0::Profile::AddressesController, V0::Profile::EmailAddressesController, V0::Profile::PermissionsController, V0::Profile::TelephonesController, V0::Profile::TransactionsController
- Defined in:
- app/controllers/concerns/vet360/writeable.rb
Instance Method Summary collapse
- #invalidate_cache ⇒ Object
-
#write_to_vet360_and_render_transaction!(type, params, http_verb: 'post') ⇒ Response
For the passed VAProfile model type and params, it: - builds and validates a VAProfile models - POSTs/PUTs the model data to VAProfile - creates a new AsyncTransaction db record, based on the type - renders the transaction through the base serializer.
Instance Method Details
#invalidate_cache ⇒ Object
28 29 30 |
# File 'app/controllers/concerns/vet360/writeable.rb', line 28 def invalidate_cache VAProfileRedis::Cache.invalidate(@current_user) end |
#write_to_vet360_and_render_transaction!(type, params, http_verb: 'post') ⇒ Response
For the passed VAProfile model type and params, it:
- builds and validates a VAProfile models
- POSTs/PUTs the model data to VAProfile
- creates a new AsyncTransaction db record, based on the type
- renders the transaction through the base serializer
21 22 23 24 25 26 |
# File 'app/controllers/concerns/vet360/writeable.rb', line 21 def write_to_vet360_and_render_transaction!(type, params, http_verb: 'post') record = build_record(type, params) validate!(record) response = write_valid_record!(http_verb, type, record) render_new_transaction!(type, response) end |