Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need an intermediate form to store serialized data #43

Open
jgaskins opened this issue Mar 13, 2014 · 1 comment
Open

Need an intermediate form to store serialized data #43

jgaskins opened this issue Mar 13, 2014 · 1 comment

Comments

@jgaskins
Copy link
Owner

Going straight from PORO to database-serialized form is hard to generalize, so I think we need an intermediate serialization layer, which will allow the serializer to be pulled out of the adapters and back into the core perpetuity gem. This intermediate form will expose all of the attributes stored in the source object so the adapter serializers won't need to dig into the user's POROs to snag instance variables and it'll help centralize all of the "what data are we storing" logic so we can start on #15.

This intermediate form could just be a hash (preferably a wrapped hash so we can give extra functionality to it if necessary), mapping the column name to the value, and the database adapter would do its serialization/sanitization based on that.

I doubt this will make it into the 1.0 release (which I'd like to do very soon), but maybe in 1.1.

@acook
Copy link

acook commented Mar 13, 2014

👍

I'm a fan of subclassing Hash (or using Hashie) for as long as it makes sense. It's then very easy to migrate to a proper Object once it outgrows this stage (if indeed it does).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants