Skip to content
This repository has been archived by the owner on Oct 19, 2018. It is now read-only.

Calling a server-side method that performs a save always rolls back #2

Open
adamcreekroad opened this issue Aug 25, 2016 · 0 comments

Comments

@adamcreekroad
Copy link
Contributor

Any fetch performs a rollback when it's done, but there are cases where someone might want to save data when calling a method. For example:

def desk_case
  case_id = super
  if !case_id && (case_id = DeskInteraction.get_case_for_order(self).to_s)
    update_attribute(:desk_case, case_id)
  end
  case_id
end

This can be worked around in application specific code, but not sure if it should be something fixed/added to ReactiveRecord.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant