<     May 2017     >
Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6  
 7  8  9 10 11 12 13  
14 15 16 17 18 19 20  
21 22 23 24 25 26 27  
28 _2_9 30 31
00:36 <adam12> jeremyevans: I'm trying to decide on composition or serialize plugin. What I'd like to do is stick arbitrary data in a JSONB column, and map it out to a specific type of object that's not necessarily a Hash. So perhaps YAML/Marshal style, but the type of class instance would either be a another column on that table or a field in the JSON blob. Any thoughts?
00:36 <adam12> I thought composition would work beautifully but you posted somewhere that you felt it was a better usecase for value objects.
00:37 <adam12> Which makes me think something immutable (as your date example).
00:37 <adam12> I'd almost want to fake-embed another model in this column, but the model could be "polymorphic".
00:39 <adam12> My other alternative is serialized plugin with my own wrapper (a factory method of some sort), but I coulda swore the composition plugin was gonna be perfect here.
00:41 pdrakeweb joined
00:46 <adam12> Maybe serialization with a custom serializer. Hmm
00:57 <adam12> https://gist.github.com/adam12/a1cca6c85e37469cd9d35d21ac23a3d6 maybe there is a better way to do it.
02:47 mahlon joined
03:58 claw joined
07:55 ta_ joined
08:03 ta_ joined
08:11 brauliobo joined
10:30 Ishiro joined
10:35 ta_ joined
12:43 mwlang joined
14:26 GitHub3 joined
14:26 <GitHub3> [13sequel] 15jeremyevans pushed 1 new commit to 06master: 02https://git.io/v9lVE
14:26 <GitHub3> 13sequel/06master 14a5a4d80 15Jeremy Evans: Bump version to 4.46.0
14:26 GitHub3 left
14:26 GitHub82 joined
14:26 <GitHub82> [13sequel] 15jeremyevans tagged 064.46.0 at 148ac8715: 02https://git.io/v9lVg
14:26 GitHub82 left
14:32 Topic for
14:34 GitHub8 joined
14:34 <GitHub8> [13sequel] 15jeremyevans pushed 1 new commit to 06gh-pages: 02https://git.io/v9lw8
14:34 <GitHub8> 13sequel/06gh-pages 140db0ed4 15Jeremy Evans: Update website for 4.46.0 release
14:34 GitHub8 left
14:42 banditron joined
15:00 pdrakewe_ joined
15:05 pdrakeweb joined
15:17 tercenya joined
15:20 mwlang joined
16:02 banditro_ joined
16:41 adam- joined
16:42 claw joined
16:57 tercenya joined
18:19 tercenya joined
18:26 <adam12> Has anybody done a polymorphic-like serialization of objects using JSON? I'd like to store the object as JSON in the database but represent it dynamically during runtime.
18:27 <adam12> I figured JSON.load / JSON.dump would work but no luck.
18:42 <adam12> So JSON.load kinda works, but I had to define the json_create class method on my custom class.
18:45 Norm joined
18:45 <Norm> I’m getting an error that this is deprecated...
18:46 <Norm> subset :active, proc {(start_at < Time.now) && (end_at > Time.now)}
18:46 <Norm> It suggests passing as blocks to the filtering method, but I’m not entirely sure what that’s referring to
18:46 <Norm> any hints?
18:51 <jeremyevans> adam12: From what you'd described yesterday, I would use the pg_json database extension. That will ensure the json is deserialized to a hash when retrieved. From there you can use the serialization plugin. Have you serializer create an instance of the appropriate class, and your deserializer call a method on that class that returns a Sequel::Postgres::JSONBHash, then things should work
18:52 <jeremyevans> Norm: subset(:active){(start_at < Time.now) && (end_at > Time.now)}
18:52 <Norm> jeremyevans: will check that out, thanks
18:52 <adam12> jeremyevans: Thanks. I've been experimenting a bit with it. I didn't realize I could pair pg_json with serialize.
19:58 ben_____ joined
19:59 ben_____ joined
20:51 ben_____ joined
21:56 tercenya joined