Class: Engine2::LoginAction

Inherits:
Action show all
Includes:
ActionApproveSupport
Defined in:
lib/engine2/action/infra.rb

Instance Attribute Summary

Attributes included from ActionApproveSupport

#validations

Attributes inherited from Action

#assets, #invokable, #meta, #node, #static

Instance Method Summary collapse

Methods included from ActionApproveSupport

#allocate_record, #before_approve, included, #invoke, #post_run, #pre_run, #validate, #validate_and_approve, #validate_fields

Methods included from ActionModelSupport

#hide_pk, #node_defined, #pre_run, #show_pk, #unsupported_association

Methods inherited from Action

action_type, #action_type, #arguments, #check_anonymous_action_class, #check_static_action, #define_invoke, #define_method, #dynamic?, #execute, #freeze_action, #http_method, http_method, inherit, inherited, #initialize, #invoke!, #join_keys, #lookup, #merge, #node_defined, #post_process, #post_run, #pre_run, #repeat, #request, #request_action_proc_params, #split_keys

Constructor Details

This class inherits a constructor from Engine2::Action

Instance Method Details

#after_approve(handler, record) ⇒ Object



290
291
292
# File 'lib/engine2/action/infra.rb', line 290

def after_approve handler, record
    handler.session[:user] = record
end

#record(handler, record) ⇒ Object



294
295
296
# File 'lib/engine2/action/infra.rb', line 294

def record handler, record
    {errors: nil, user!: handler.user.to_hash}
end

#validate_record(handler, record, parent_id) ⇒ Object



285
286
287
288
# File 'lib/engine2/action/infra.rb', line 285

def validate_record handler, record, parent_id
    super
    record.values[:password] = nil
end