Class: User::UpdateDetails::PasswordDetails

Inherits:
Struct
  • Object
show all
Defined in:
app/models/user/update_details.rb

Overview

Setting the plural route key won’t work, polymorphic_url will still generate a path key with the singular name, so the inflector was updated in this case. model_name.instance_variable_set(:@singular_route_key, ‘update_details’)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_passwordObject

Returns the value of attribute current_password

Returns:

  • (Object)

    the current value of current_password



10
11
12
# File 'app/models/user/update_details.rb', line 10

def current_password
  @current_password
end

#passwordObject

Returns the value of attribute password

Returns:

  • (Object)

    the current value of password



10
11
12
# File 'app/models/user/update_details.rb', line 10

def password
  @password
end

#password_confirmationObject

Returns the value of attribute password_confirmation

Returns:

  • (Object)

    the current value of password_confirmation



10
11
12
# File 'app/models/user/update_details.rb', line 10

def password_confirmation
  @password_confirmation
end

Instance Method Details

#changed?Boolean

Returns:

  • (Boolean)


11
12
13
14
# File 'app/models/user/update_details.rb', line 11

def changed?
  has_passwords = password || password_confirmation
  has_passwords && (!password.empty? || !password_confirmation.empty?)
end