Class: ActiveRecord::Embedded::Field::String

Inherits:
ActiveRecord::Embedded::Field show all
Defined in:
lib/active_record/embedded/field/string.rb

Overview

Convert the value of the field this represents into a String for JSON.

Constant Summary

Constants inherited from ActiveRecord::Embedded::Field

PREFIX

Instance Attribute Summary

Attributes inherited from ActiveRecord::Embedded::Field

#default, #name

Instance Method Summary collapse

Methods inherited from ActiveRecord::Embedded::Field

#coerce, #default?, #default_method_name, find, #initialize, types

Constructor Details

This class inherits a constructor from ActiveRecord::Embedded::Field

Instance Method Details

#cast(value) ⇒ Object


9
10
11
# File 'lib/active_record/embedded/field/string.rb', line 9

def cast(value)
  value.to_s
end