Class: ActiveRecord::Type::Set
- Inherits:
-
Type::Value
- Object
- Type::Value
- ActiveRecord::Type::Set
- Defined in:
- lib/native_enum/activerecord_enum_post42.rb
Instance Method Summary collapse
-
#deserialize(value) ⇒ Object
(also: #type_cast_from_database)
Deserialize value from the database.
-
#initialize(options = {}) ⇒ Set
constructor
A new instance of Set.
- #type ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Set
Returns a new instance of Set.
53 54 55 56 |
# File 'lib/native_enum/activerecord_enum_post42.rb', line 53 def initialize( = {}) .assert_valid_keys(:limit) @limit = [:limit] end |
Instance Method Details
#deserialize(value) ⇒ Object Also known as: type_cast_from_database
Deserialize value from the database
See: github.com/rails/rails/blob/v5.0.7/activemodel/lib/active_model/type/value.rb#L15-L23
61 62 63 |
# File 'lib/native_enum/activerecord_enum_post42.rb', line 61 def deserialize(value) value.split(",") end |
#type ⇒ Object
49 50 51 |
# File 'lib/native_enum/activerecord_enum_post42.rb', line 49 def type :set end |