Skip to content

Commit

Permalink
Add comment and lint (#3022)
Browse files Browse the repository at this point in the history
Co-authored-by: Adrian Marin <adrian@adrianthedev.com>
  • Loading branch information
binarygit and adrianthedev authored Jul 19, 2024
1 parent c72f35e commit 425a56a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spec/dummy/app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class User < ApplicationRecord
scope :admins, -> { where "(roles->>'admin')::boolean is true" }
scope :non_admins, -> { where "(roles->>'admin')::boolean != true" }

# We're using a setter here because we want to test that the field is working properly with a non-db backed field.
attr_writer :permissions

def is_admin?
Expand Down Expand Up @@ -96,7 +97,7 @@ def permissions
create: true,
update: false,
read: true,
delete: true,
delete: true
}
end
end

0 comments on commit 425a56a

Please sign in to comment.