Sha256: 31309a494e2e657c11564870a4bb76833f2dde3c76a822f550afc728a40ec8cb

Contents?: true

Size: 757 Bytes

Versions: 13

Compression:

Stored size: 757 Bytes

Contents

module SharedUser
  extend ActiveSupport::Concern

  included do
    devise :database_authenticatable, :confirmable, :lockable, :recoverable,
           :registerable, :rememberable, :timeoutable, :token_authenticatable,
           :trackable, :validatable, :omniauthable

    attr_accessor :other_key
    attr_accessible :username, :email, :password, :password_confirmation, :remember_me, :confirmation_sent_at

    # They need to be included after Devise is called.
    extend ExtendMethods
  end

  module ExtendMethods
    def new_with_session(params, session)
      super.tap do |user|
        if data = session["devise.facebook_data"]
          user.email = data["email"]
          user.confirmed_at = Time.now
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
devise-2.2.8 test/rails_app/lib/shared_user.rb
devise-2.2.7 test/rails_app/lib/shared_user.rb
devise-2.2.6 test/rails_app/lib/shared_user.rb
devise-2.2.5 test/rails_app/lib/shared_user.rb
devise-2.2.4 test/rails_app/lib/shared_user.rb
devise-warbler-2.2.3 test/rails_app/lib/shared_user.rb
devise-2.2.3 test/rails_app/lib/shared_user.rb
devise-2.2.2 test/rails_app/lib/shared_user.rb
devise-2.2.1 test/rails_app/lib/shared_user.rb
devise-2.2.0 test/rails_app/lib/shared_user.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/devise-2.2.0.rc/test/rails_app/lib/shared_user.rb
devise-2.2.0.rc test/rails_app/lib/shared_user.rb
af-devise-2.1.2 test/rails_app/lib/shared_user.rb