Skip to content

Commit 50dd7f1

Browse files
committed
add supports for read_only models
making the read_only logic more consistent
1 parent 9c70aba commit 50dd7f1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/models/mixins/read_only_mixin.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ module ReadOnlyMixin
33

44
included do
55
before_destroy :reject_if_read_only
6+
supports(:update) { _("Can not edit read only model") if read_only? }
7+
supports(:delete) { _("Can not delete read only model") if read_only? }
68
end
79

810
private

0 commit comments

Comments
 (0)