Skip to content

Conversation

composerinteralia
Copy link
Member

@composerinteralia composerinteralia commented Apr 22, 2019

No rush on reviewing this PR. This can definitely wait until after the next release

This adds .attribute_names and #attribute_names to ActiveModel::Attributes along the same lines as the corresponding methods in ActiveRecord::AttributeMethods (see .attribute_names and #attribute_names).

While I was here I also added documentation for #attributes, which I added in 043ce35. The whole module is still #:nodoc: so I don't think this will have any effect for now.

I do have questions about future plans for ActiveModel::Attributes. Is there something in particular that is holding us back documenting this publicly (7e9ded5 mentions that it was not ready yet, but I don't know exactly what is missing)? I have used it successfully on a few projects, not quite realizing is wasn't documented. If there are specific things that we need to work on I would be happy to take that on.

This adds `.attribute_names` and `#attribute_names` to
`ActiveModel::Attributes` along the same lines as the corresponding
methods in `ActiveRecord::AttributeMethods` (see
[`.attribute_names`][class_method] and
[`#attribute_names`][instance_method].

While I was here I also added documentation for '#attributes', which I
added in 043ce35. The whole class is still `#:nodoc:` so I don't
think this will have any effect for now.

[class_method]: https://github.com/rails/rails/blob/cc834db1d0815744cfa173813c05d928e008e167/activerecord/lib/active_record/attribute_methods.rb#L154-L160
[instance_method]: https://github.com/rails/rails/blob/cc834db1d0815744cfa173813c05d928e008e167/activerecord/lib/active_record/attribute_methods.rb#L299-L301
@rafaelfranca
Copy link
Member

Is there something in particular that is holding us back documenting this publicly?

Writing the high level documentation, reviewing the low level documentation and the API to see if there is something missing.

Nobody is working on that right now so if you want that would be helpful.

@rafaelfranca rafaelfranca merged commit 3d0118f into rails:master Apr 23, 2019
@composerinteralia composerinteralia deleted the model-attribute-names branch April 23, 2019 15:47
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.

2 participants