Class: ActiveRecordEncryption::Quoter

Inherits:
Object
  • Object
show all
Includes:
ActiveRecord::ConnectionAdapters::Quoting, Singleton
Defined in:
lib/active_record_encryption/quoter.rb

Overview

Serialize ruby object to string for encryption.

Instance Method Summary collapse

Instance Method Details

#default_timezoneSymbol

Returns:

  • (Symbol)


30
31
32
# File 'lib/active_record_encryption/quoter.rb', line 30

def default_timezone
  ActiveRecord::Base.connection.default_timezone
end

#type_cast(value) ⇒ Object

Cast value to string



23
24
25
26
# File 'lib/active_record_encryption/quoter.rb', line 23

def type_cast(value)
  return value.to_s if value.is_a?(Numeric)
  super(value)
end

#unquoted_falseObject

minimum length of string for encryption



17
18
19
# File 'lib/active_record_encryption/quoter.rb', line 17

def unquoted_false
  'f'
end

#unquoted_trueObject

minimum length of string for encryption



12
13
14
# File 'lib/active_record_encryption/quoter.rb', line 12

def unquoted_true
  't'
end