Skip to content

Commit 9d04f7f

Browse files
authored
Merge pull request #945 from amatsuda/identity_provider_enum
Enum for Identity#provider
2 parents 49ad209 + 51026ae commit 9d04f7f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/models/identity.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
class Identity < ApplicationRecord
22
PROVIDER_NAMES = {'github' => 'GitHub', 'twitter' => 'Twitter'}.freeze
33

4+
enum :provider, {github: 'github', twitter: 'twitter'}, scopes: false, instance_methods: false
5+
46
belongs_to :user
57

68
validates :provider, presence: true

0 commit comments

Comments
 (0)