Sha256: 19ecfb6ae68bc0cafaa4858b40a6dd4cab59d4ede88a12ea7f83429087eb8813

Contents?: true

Size: 734 Bytes

Versions: 39

Compression:

Stored size: 734 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

    # 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

39 entries across 34 versions & 6 rubygems

Version Path
devise-2.0.6 test/rails_app/lib/shared_user.rb
devise-2.1.4 test/rails_app/lib/shared_user.rb
devise_sociable-0.1.0 vendor/bundle/gems/devise-1.5.4/test/rails_app/lib/shared_user.rb
devise-2.1.3 test/rails_app/lib/shared_user.rb
devise-2.0.5 test/rails_app/lib/shared_user.rb
devise-1.5.4 test/rails_app/lib/shared_user.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/devise-2.1.0/test/rails_app/lib/shared_user.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/devise-2.0.4/test/rails_app/lib/shared_user.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/devise-2.0.4/test/rails_app/lib/shared_user.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/devise-2.1.0/test/rails_app/lib/shared_user.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/devise-2.0.4/test/rails_app/lib/shared_user.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/devise-2.1.0/test/rails_app/lib/shared_user.rb
devise-2.1.2 test/rails_app/lib/shared_user.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/devise-2.1.0/test/rails_app/lib/shared_user.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/devise-2.0.4/test/rails_app/lib/shared_user.rb
rmello-devise-2.1.0.2 test/rails_app/lib/shared_user.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/devise-2.1.0/test/rails_app/lib/shared_user.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/devise-2.0.4/test/rails_app/lib/shared_user.rb
devise-2.1.0 test/rails_app/lib/shared_user.rb
devise-2.1.0.rc2 test/rails_app/lib/shared_user.rb