Sha256: 1e1dd22db7bce797cf789278d8f9e13f61d71e13e52750aac10cb7da061a8cd4

Contents?: true

Size: 634 Bytes

Versions: 5

Compression:

Stored size: 634 Bytes

Contents

# frozen_string_literal: true

module GraphqlDevise
  module AdditionalModelMethods
    extend ActiveSupport::Concern

    class_methods do
      def reconfirmable
        column_attributes = try(:column_names) || []
        fields_attributes = try(:fields)&.keys || []
        has_unconfirmed_email_attr = column_attributes.include?('unconfirmed_email') || fields_attributes.include?('unconfirmed_email')
        devise_modules.include?(:confirmable) && has_unconfirmed_email_attr
      end
    end

    def update_with_email(attributes = {})
      GraphqlDevise::Model::WithEmailUpdater.new(self, attributes).call
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
graphql_devise-2.0.0 lib/graphql_devise/concerns/additional_model_methods.rb
graphql_devise-1.4.0 lib/graphql_devise/concerns/additional_model_methods.rb
graphql_devise-1.3.0 lib/graphql_devise/concerns/additional_model_methods.rb
graphql_devise-1.2.0 lib/graphql_devise/concerns/additional_model_methods.rb
graphql_devise-1.1.1 lib/graphql_devise/concerns/additional_model_methods.rb