mixing in some sorcery auth
This commit is contained in:
3
app/models/authentication.rb
Normal file
3
app/models/authentication.rb
Normal file
@ -0,0 +1,3 @@
|
||||
class Authentication < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
end
|
@ -1,6 +1,9 @@
|
||||
class Person < ActiveRecord::Base
|
||||
authenticates_with_sorcery!
|
||||
has_many :parenthoods
|
||||
has_many :children, through: :parenthoods
|
||||
has_many :authentications, dependent: :destroy
|
||||
accepts_nested_attributes_for :authentications
|
||||
accepts_nested_attributes_for :children, reject_if: :all_blank
|
||||
|
||||
validates :first_name, presence: true
|
||||
@ -30,4 +33,10 @@ class Person < ActiveRecord::Base
|
||||
def to_i
|
||||
id
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
## SorceryCore expects the model to hold a crypted_password field
|
||||
## Since we are only using external oAuth providers, faking this one out.
|
||||
def crypted_password; end
|
||||
end
|
||||
|
Reference in New Issue
Block a user