Skip to content

Commit

Permalink
add is_confirmed and is_locked to user type
Browse files Browse the repository at this point in the history
  • Loading branch information
simonfranzen committed Sep 20, 2020
1 parent aa9fc38 commit db0978f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ RSpec/ExampleLength:
Max: 10
RSpec/MultipleMemoizedHelpers:
Max: 10
Naming/PredicateName:
Exclude:
- "app/graphql/**/*"
10 changes: 10 additions & 0 deletions app/graphql/types/users/user_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ class UserType < Types::BaseModel
field :email, String, null: true
field :role, String, null: false
field :company, Types::Companies::CompanyType, null: false

field :is_confirmed, Boolean, null: false
def is_confirmed
object.confirmed?
end

field :is_locked, Boolean, null: false
def is_locked
object.access_locked?
end
end
end
end
2 changes: 2 additions & 0 deletions spec/graphql/resolvers/users/me_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
query {
me {
name
isConfirmed
isLocked
}
}
GRAPHQL
Expand Down

0 comments on commit db0978f

Please sign in to comment.