Sha256: d6524583c30fa3396865bf26d82cc8289a73f00d3e6fdd6606640fb069e9eeb4
Contents?: true
Size: 630 Bytes
Versions: 11
Compression:
Stored size: 630 Bytes
Contents
require 'bigdecimal' module CouchPotato module Persistence module DirtyAttributes def self.included(base) #:nodoc: base.send :include, ActiveModel::Dirty base.class_eval do after_save :clear_changes_information end end def clone_attribute(value) if [Integer, Symbol, TrueClass, FalseClass, NilClass, Float, BigDecimal].find{|klass| value.is_a?(klass)} value elsif [Hash, Array].include?(value.class) #Deep clone Marshal::load(Marshal::dump(value)) else value.clone end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems