mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Fix attribute locking namespace conflict, duplicate syncs
This commit is contained in:
parent
ab5bce3462
commit
137219c121
11 changed files with 87 additions and 28 deletions
|
@ -42,17 +42,17 @@ module Enrichable
|
|||
!locked?(attr)
|
||||
end
|
||||
|
||||
def lock!(attr)
|
||||
def lock_attr!(attr)
|
||||
update!(locked_attributes: locked_attributes.merge(attr.to_s => Time.current))
|
||||
end
|
||||
|
||||
def unlock!(attr)
|
||||
def unlock_attr!(attr)
|
||||
update!(locked_attributes: locked_attributes.except(attr.to_s))
|
||||
end
|
||||
|
||||
def lock_saved_attributes!
|
||||
saved_changes.keys.reject { |attr| ignored_enrichable_attributes.include?(attr) }.each do |attr|
|
||||
lock!(attr)
|
||||
lock_attr!(attr)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue