Skip to content

Commit

Permalink
Update Archivable to avoid persisting records when archiving
Browse files Browse the repository at this point in the history
  • Loading branch information
sfnelson committed Jul 18, 2024
1 parent 3bd70f9 commit aa5f19a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
katalyst-koi (4.10.1)
katalyst-koi (4.10.2)
bcrypt
importmap-rails
katalyst-content
Expand Down
4 changes: 2 additions & 2 deletions app/models/concerns/koi/model/archivable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def archive
# Archive a record immediately, without validation.
def archive!
archive
save!(validate: false)
save!(validate: false) if persisted?
end

# Mark a record as no longer archived. It will appear in default queries.
Expand All @@ -80,7 +80,7 @@ def restore
# Restore a record immediately, without validation.
def restore!
restore
save!(validate: false)
save!(validate: false) if persisted?
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion katalyst-koi.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "katalyst-koi"
s.version = "4.10.1"
s.version = "4.10.2"
s.authors = ["Katalyst Interactive"]
s.email = ["[email protected]"]

Expand Down

0 comments on commit aa5f19a

Please sign in to comment.