Serialized Hash in Rails form

0

review of what a hash is
> schedule = {mon: true, tue: false, wed: true}
> schedule[:mon]
=> true
> schedule[:tue]
=> false
> schedule[:wed]
=> true
> schedule[:thu]
=> nil
> schedule.class
=> Hash
models/availability.rb
class Availability < ApplicationRecord
  serialize :schedule, Hash
  belongs_to :user
end

  • 0 posts
  • 0 subtopics
  • about 1 month ago by vince