Skip to content
Snippets Groups Projects
Verified Commit 6f6a0b28 authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Expose Resource#modified? as public

Can be useful when doing conditional saving of resources or similar
functionality
parent aaace4e2
Branches
Tags
No related merge requests found
Pipeline #97444 failed
...@@ -151,6 +151,12 @@ module Passwordstate ...@@ -151,6 +151,12 @@ module Passwordstate
end end
end end
def modified?(field = nil)
return modified.any? unless field
modified.include? field
end
protected protected
def api_path def api_path
...@@ -162,10 +168,6 @@ module Passwordstate ...@@ -162,10 +168,6 @@ module Passwordstate
attribs.reject { |field| old[field] == attribs[field] } attribs.reject { |field| old[field] == attribs[field] }
end end
def modified?(field)
modified.include? field
end
def old def old
@old ||= attributes.dup @old ||= attributes.dup
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment