Sha256: 8a9a1c59ceb6b5506063f4067247af6c5619144864eb82789fcdd753bf972b4f
Contents?: true
Size: 1023 Bytes
Versions: 31
Compression:
Stored size: 1023 Bytes
Contents
# frozen_string_literal: true module Mobility module Plugins =begin Dirty tracking for Mobility attributes. See class-specific implementations for details. @see Mobility::Plugins::ActiveModel::Dirty @see Mobility::Plugins::ActiveRecord::Dirty @see Mobility::Plugins::Sequel::Dirty @note Dirty tracking can have unexpected results when combined with fallbacks. A change in the fallback locale value will not mark an attribute falling through to that locale as changed, even though it may look like it has changed. See the specs for details on expected behavior. =end module Dirty extend Plugin default true requires :backend, include: :before requires :fallthrough_accessors initialize_hook do if options[:dirty] && !options[:fallthrough_accessors] warn 'The Dirty plugin depends on Fallthrough Accessors being enabled, '\ 'but fallthrough_accessors option is falsey' end end end register_plugin(:dirty, Dirty) end end
Version data entries
31 entries across 31 versions & 1 rubygems