Nikita Shilnikov

Results 163 comments of Nikita Shilnikov

I guess polyvars for colors isn't particularly a good fit, `#00FF00` won't work, will it? 😄

For the record, dry-struct 1.0 has support for "direct loading" i.e. without type checks. It's done internally via `allocate` + `send(:initialize, attributes)`. It's ok to instantiate structs this way when...

It is a gem.

@mereghost rom-factory does that, have you seen it?

@solnic type metadata will be missing, it can be a problem in some cases. For instance, you won't be able to notice column renaming. Otherwise, it's possible with `method_missing` and...

though I think I would go with a different name, `Struct.build` or something

@solnic linking `User` to a container would require some sort of a global state, this concerns me somewhat :)

@solnic no, it's the other way around, container references classes. Currently, `User` is an empty class that can be easily shared by multiple containers with (possibly) different schemas

`ROM::Abstruct` :) > It just occurred to me though that maybe it would be possible to have your classes use the default schema and already be concrete. Then we could...

Got an idea, here's a sketch ```ruby module AbstractEntities class User < ROM::Struct end end # somewhere else App.boot(:persistence) do |container| init do rom = ... Entities = rom.make_structs(AbstractEntities) end...