Skip to content

Commit

Permalink
add supports for read_only models
Browse files Browse the repository at this point in the history
making the read_only logic more consistent
  • Loading branch information
kbrock committed Aug 10, 2024
1 parent 9c70aba commit 50dd7f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/mixins/read_only_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module ReadOnlyMixin

included do
before_destroy :reject_if_read_only
supports(:update) { _("Can not edit read only model") if read_only? }
supports(:delete) { _("Can not delete read only model") if read_only? }
end

private
Expand Down

0 comments on commit 50dd7f1

Please sign in to comment.