Sha256: e6615495234180c833bc47d3c55c2a2ffd6246c72fef9260634613e7915b5e2e

Contents?: true

Size: 555 Bytes

Versions: 31

Compression:

Stored size: 555 Bytes

Contents

# frozen_string_literal: true

require 'active_support/concern'

module BaseEditingBootstrap

  module IsValidated
    extend ActiveSupport::Concern

    included do
      ##
      # Helpers per settare su un record quando abbiamo eseguito o meno la validazione e quindi
      # utilizzare questa informazione nella renderizzazione dello stato della form.
      attr_reader :is_validated
      alias_method :validated?, :is_validated
      after_initialize -> { @is_validated = false }
      after_validation -> { @is_validated = true }
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
base_editing_bootstrap-1.6.0 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-1.5.1 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-1.5.0 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-1.4.0 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-1.3.2 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-1.3.1 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-1.3.0 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-1.2.0 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-1.1.0 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-1.0.0 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-0.16.1 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-0.16.0 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-0.15.0 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-0.14.0 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-0.13.0 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-0.12.0 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-0.11.0 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-0.10.2 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-0.10.1 lib/base_editing_bootstrap/is_validated.rb
base_editing_bootstrap-0.10.0 lib/base_editing_bootstrap/is_validated.rb