Skip to content

[WIP] Convert from Virtus to ActiveAttr #395

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

Closed
wants to merge 4 commits into from

Conversation

ryansch
Copy link
Contributor

@ryansch ryansch commented May 13, 2015

I've had so many issues with the way Virtus decides to do things that I finally gave up and ripped it out in favor of ActiveAttr.

@ryansch ryansch changed the title Convert from Virtus to ActiveAttr [WIP] Convert from Virtus to ActiveAttr May 13, 2015
@karmi
Copy link
Contributor

karmi commented May 20, 2015

@ryansch I like the idea itself -- many people seem to have performance and other issues with Virtus.

What I'm thinking though, is that it would be best to make this support pluggable, in the spirit of "adapters" we have in elasticsearch-model for ActiveRecord, Mongoid, etc etc etc.

My reasoning would not be of academical, but of practical nature: so we rip out Virtus, add ActiveAttr, then after some time something better comes, we again change the code, etc etc etc. Can you give it some thinking and maybe play with it a bit?

@ryansch
Copy link
Contributor Author

ryansch commented May 20, 2015

I was wondering the same thing. Honestly the contract we have with the model is pretty thin so making this pluggable would be pretty easy.

@ryansch
Copy link
Contributor Author

ryansch commented May 20, 2015

I've paired this down to just the active_attr stuff. I'll try to add the plugin architecture in the next couple weeks.

@karmi
Copy link
Contributor

karmi commented May 20, 2015

That would be awesome! Take your time and please ping me whenever you'd like to get some feedback or ping-pong something.

@ryansch ryansch force-pushed the active_attr branch 2 times, most recently from c202b4c to 3d2dd66 Compare May 22, 2015 15:26
@ryansch
Copy link
Contributor Author

ryansch commented Nov 3, 2015

Just FYI, I haven't forgotten about this.

@karmi
Copy link
Contributor

karmi commented Nov 4, 2015

@ryansch, that's great to hear :) Take your time!

@gmile
Copy link

gmile commented Jan 5, 2016

@ryansch it looks like original author of virtus himself is abandoning the project. So virtus issues you're seeing are unlikely to be ever resolved, unless someone takes over the project. Yet even in that case I doubt virtus will remain a good choise, for reasons he well explained in this thread on reddit.

It's been a year since last commit in active_attr, maybe it's worth considering an alternative to active_attr as a default attrs lib, like the dry-data? What do you think?

@ryansch
Copy link
Contributor Author

ryansch commented Jan 5, 2016

I think I'd still like to add a pluggable interface so you can use whatever you want. :-)

We'll just have to decide what the default is.

Edit: By the author's own admission dry-data isn't production ready yet.
Edit2: This is still in the pipeline for me. I'm hoping to get to it in the next couple months.

@gmile
Copy link

gmile commented Jan 5, 2016

by the author's own admission dry-data isn't production ready yet

@ryansch you're right.

I'm just thinking outloud. active_attr depends on both activemodel and activesupport, and I'm a little biased towards both (those dependencies feel a bit too heavy for the task). But that's just me.

Upd. Realized elasticsearch-persistence depends on activemodel and activesupport too... So they hardly can be used as an argument against active_attr. Oh well. Please, ignore my comment above!

@karmi
Copy link
Contributor

karmi commented Jan 5, 2016

I think I'd still like to add a pluggable interface so you can use whatever you want. :-)

+++ :)

(It's just a question how much benefit would be in abstracting everything away like that...)

@ryansch ryansch force-pushed the active_attr branch 2 times, most recently from 0c70d25 to c05022b Compare October 25, 2017 20:29
@estolfo
Copy link
Contributor

estolfo commented Aug 3, 2018

I'm going to close this, as it's no longer relevant with the removal of Elasticsearch::Persistence::Model.

@estolfo estolfo closed this Aug 3, 2018
@ryansch
Copy link
Contributor Author

ryansch commented Aug 3, 2018

🎉

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

Successfully merging this pull request may close these issues.

4 participants