Sha256: f5a59838ee6d5741ecd1ddbe663e6c3fbbc79a8a22f4903111f75e0e2ad95d3b

Contents?: true

Size: 546 Bytes

Versions: 10

Compression:

Stored size: 546 Bytes

Contents

class DeviseInvitable::RegistrationsController < Devise::RegistrationsController
  protected

  def build_resource(hash = nil)
    hash ||= resource_params || {}
    if hash[:email]
      self.resource = resource_class.where(:email => hash[:email], :encrypted_password => '').first
      if self.resource
        self.resource.attributes = hash
        self.resource.send_confirmation_instructions if self.resource.confirmation_required_for_invited?
        self.resource.accept_invitation
      end
    end
    self.resource ||= super
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
devise_invitable-1.5.1 app/controllers/devise_invitable/registrations_controller.rb
devise_invitable-1.5.0 app/controllers/devise_invitable/registrations_controller.rb
devise_invitable-1.4.2 app/controllers/devise_invitable/registrations_controller.rb
devise_invitable-1.4.1 app/controllers/devise_invitable/registrations_controller.rb
devise_invitable-1.4.0 app/controllers/devise_invitable/registrations_controller.rb
devise_invitable-1.3.6 app/controllers/devise_invitable/registrations_controller.rb
devise_invitable-1.3.5 app/controllers/devise_invitable/registrations_controller.rb
devise_invitable-1.3.4 app/controllers/devise_invitable/registrations_controller.rb
devise_invitable-1.3.3 app/controllers/devise_invitable/registrations_controller.rb
devise_invitable-1.3.2 app/controllers/devise_invitable/registrations_controller.rb