Sha256: b8b65cbf70f0dd91b62c258cef74ae7fdd55954f48ae0984f15fb6487056037d
Contents?: true
Size: 625 Bytes
Versions: 3
Compression:
Stored size: 625 Bytes
Contents
module DeviseIosRails class ChangePasswordService attr_reader :params, :current_user def initialize(current_user, params) @params = Hash(params) @current_user = current_user end def call! return if current_user.nil? current_user.password = snake_case_params[:password] current_user.password_confirmation = snake_case_params[:password_confirmation] current_user.save current_user end private def snake_case_params params.deep_transform_keys do |key| underscore = key.to_s.underscore underscore.to_sym end end end end
Version data entries
3 entries across 3 versions & 1 rubygems