Sha256: aac0e84e6cae19c23290f282b41ecdfb9904b94896508157e112de9f34c0693a

Contents?: true

Size: 446 Bytes

Versions: 1

Compression:

Stored size: 446 Bytes

Contents

Spree::User.class_eval do
  has_many :user_authentications, :dependent => :destroy

  devise :omniauthable

  def apply_omniauth(omniauth)
    if omniauth['provider'] == "facebook"
      self.email = omniauth['info']['email'] if email.blank?
    end
    user_authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'])
  end

  def password_required?
    (user_authentications.empty? || !password.blank?) && super
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree_social_onr-2.1.4 app/models/spree/user_decorator.rb