Sha256: 1d57aece2299cb4aab23e41a581eee93af46cafb26c3bd2867a855aafc72cbcb

Contents?: true

Size: 383 Bytes

Versions: 1

Compression:

Stored size: 383 Bytes

Contents

module ActiveRecord
	module Confirmable
		extend ActiveSupport::Concern

		included do
			validates_acceptance_of :confirmed
			after_rollback :check_confirming
		end

	  def check_confirming
			errors.messages.delete( :confirmed )
			self.confirmed = errors.empty? ? '1' : '' if self.confirmed
	  end

		def confirmation?
			!self.confirmed.blank?
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord-confirmable-1.0.0 lib/activerecord-confirmable/active_record/confirmable.rb