-
Notifications
You must be signed in to change notification settings - Fork 25
Add array type for property #5
Copy link
Copy link
Open
Description
Once we have typecasting, we should support array as a type:
class Post < YamlRecord::Base
property :names, Array
property :user_ids, Array[Integer]
endand that should allow:
p = Post.new
p.names = ["Bob", "Jane"]
p.user_ids = [1,2,3,4,5]
p.saveto
---
names: ["Bob", "Jane"]
user_id: [1,2,3,4,5]but also support lists in string form:
p = Post.new
p.names = "Bob, Jane"
p.user_ids = "1, 2, 3, 4, 5"
p.save
p.names # => ["Bob", "Jane"]
p.user_ids # => [1,2,3,4,5]Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels