class ActiveRecord::Type::Set

Public Class Methods

new(options = {}) click to toggle source
# File lib/native_enum/activerecord_enum_post42.rb, line 53
def initialize(options = {})
  options.assert_valid_keys(:limit)
  @limit = options[:limit]
end

Public Instance Methods

deserialize(value) click to toggle source

Deserialize value from the database

See: github.com/rails/rails/blob/v5.0.7/activemodel/lib/active_model/type/value.rb#L15-L23

# File lib/native_enum/activerecord_enum_post42.rb, line 61
def deserialize(value)
  value.split(",")
end
Also aliased as: type_cast_from_database
type() click to toggle source
# File lib/native_enum/activerecord_enum_post42.rb, line 49
def type
  :set
end
type_cast_from_database(value)

deserialize used to be called type_cast_from_database before v5

Alias for: deserialize