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

Remove active attr #48

Merged
merged 11 commits into from
Feb 20, 2017
Merged

Remove active attr #48

merged 11 commits into from
Feb 20, 2017

Conversation

brianstien
Copy link
Collaborator

Over time, this project has slowly started to override significant parts of active_attr. This has gotten to a point where we have diverged significantly from active_attr and it is now very difficult to understand our interactions with active_attr.

This pulls in the remaining classes from active_attr and drops the dependency so that we can make do some significant refactoring in the 3.0 release.

@@ -1,5 +1,33 @@
module ActiveRemote
module Attributes
extend ActiveSupport::Concern
include ActiveModel::AttributeMethods
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work? I can see specs are passing, but I'd expect this to have to be included in the base class.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a direct holdover from active_attr, and the ability it has to be used piecemeal.

https://github.com/cgriego/active_attr/blob/master/lib/active_attr/attributes.rb#L24

Certainly will be refactoring this in the next pull request, since we do not need the ability to use pieces.

# Person.attribute_names
#
def attribute_names
attributes.keys
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I was thinking we could check instead of respond_to when we get to optimizations.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the 3.0 roadmap to make sure we addres any performance issues with the write_attribute method.

include ActiveAttr::QueryAttributes
include ActiveAttr::Serialization
extend ::ActiveModel::Naming
include ActiveModel::Conversion
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep scope resolution consistent. I'm good either way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was planning on fixing this to be explicit for the entire project later...I can do that now though?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly wanted to make sure it was on your radar.

@liveh2o
Copy link
Owner

liveh2o commented Feb 20, 2017

84cdacb4-f226-11e6-8ee1-511c30199a1c

@liveh2o
Copy link
Owner

liveh2o commented Feb 20, 2017

:shipit:

@liveh2o liveh2o merged commit cd7a20c into liveh2o:master Feb 20, 2017
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

Successfully merging this pull request may close these issues.

2 participants