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
No related branches found
No related tags found
No related merge requests found
Pipeline #97444 failed
......@@ -151,6 +151,12 @@ module Passwordstate
end
end
def modified?(field = nil)
return modified.any? unless field
modified.include? field
end
protected
def api_path
......@@ -162,10 +168,6 @@ module Passwordstate
attribs.reject { |field| old[field] == attribs[field] }
end
def modified?(field)
modified.include? field
end
def old
@old ||= attributes.dup
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment