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

Make more class attributes inheritable #1255

Merged
merged 1 commit into from
Oct 9, 2015

Conversation

bf4
Copy link
Member

@bf4 bf4 commented Oct 7, 2015

No description provided.

class_attribute :_type, instance_reader: true
class_attribute :_attributes
self._attributes ||= []
class_attribute :_attributes_keys
Copy link
Contributor

Choose a reason for hiding this comment

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

style-wise, should the assignments be right next to eachother, rather than separated by a class_attribute definition?

Copy link
Member Author

Choose a reason for hiding this comment

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

no idea

Copy link
Contributor

Choose a reason for hiding this comment

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

well, I guess it's my personal preference to group that kind of stuff together. makes it slightly easier to skim, imo

Copy link
Member Author

Choose a reason for hiding this comment

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

Ex or pr?

B mobile phone

On Oct 7, 2015, at 6:36 AM, L. Preston Sego III notifications@github.com wrote:

In lib/active_model/serializer.rb:

 with_options instance_writer: false, instance_reader: false do |serializer|
  •  class_attribute :_type, instance_reader: true
    
  •  class_attribute :_attributes
    
  •  self._attributes ||= []
    
  •  class_attribute :_attributes_keys
    
    well, I guess it's my personal preference to group that kind of stuff together. makes it slightly easier to skim, imo


Reply to this email directly or view it on GitHub.

Copy link
Contributor

Choose a reason for hiding this comment

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

huh?

Copy link
Member Author

Choose a reason for hiding this comment

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

Meant example code of what you prefer.

B mobile phone

On Oct 8, 2015, at 2:53 PM, L. Preston Sego III notifications@github.com wrote:

In lib/active_model/serializer.rb:

 with_options instance_writer: false, instance_reader: false do |serializer|
  •  class_attribute :_type, instance_reader: true
    
  •  class_attribute :_attributes
    
  •  self._attributes ||= []
    
  •  class_attribute :_attributes_keys
    
    huh?


Reply to this email directly or view it on GitHub.

Copy link
Contributor

Choose a reason for hiding this comment

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

@bf4 I think he prefers having all the class_attribute grouped together, and then the stuff ||= stuff. I personally do not have an opinion on the matter.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think i like either but inclined to this. Good to merge?

B mobile phone

On Oct 8, 2015, at 6:25 PM, Lucas Hosseini notifications@github.com wrote:

In lib/active_model/serializer.rb:

 with_options instance_writer: false, instance_reader: false do |serializer|
  •  class_attribute :_type, instance_reader: true
    
  •  class_attribute :_attributes
    
  •  self._attributes ||= []
    
  •  class_attribute :_attributes_keys
    
    @bf4 I think he prefers having all the class_attribute grouped together, and then the stuff ||= stuff. I personally do not have an opinion on the matter.


Reply to this email directly or view it on GitHub.

@bf4
Copy link
Member Author

bf4 commented Oct 8, 2015

@rails-api/ams nu?

@beauby
Copy link
Contributor

beauby commented Oct 8, 2015

LGTM 👍

@NullVoxPopuli
Copy link
Contributor

LTGM 👍

On Thu, Oct 8, 2015, 6:37 PM Lucas Hosseini notifications@github.com
wrote:

LGTM [image: 👍]


Reply to this email directly or view it on GitHub
#1255 (comment)
.

bf4 added a commit that referenced this pull request Oct 9, 2015
@bf4 bf4 merged commit f52ade2 into rails-api:master Oct 9, 2015
@bf4 bf4 deleted the serialize_inheritable_attributes branch October 9, 2015 08:10
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.

3 participants