Module: SchemaPlus::DbDefault::ActiveRecord::Attribute

Defined in:
lib/schema_plus/db_default/active_record/attribute.rb

Instance Method Summary collapse

Instance Method Details

#original_valueObject



5
6
7
8
9
10
11
# File 'lib/schema_plus/db_default/active_record/attribute.rb', line 5

def original_value
  # prevent attempts to cast DB_DEFAULT to the attributes type.
  # We want to keep it as DB_DEFAULT so that we can handle it when
  # generating the sql.
  return DB_DEFAULT if value_before_type_cast.equal? DB_DEFAULT
  super
end