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

Add attr_readonly to list of Symbols #332

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

natematykiewicz
Copy link
Contributor

Fixes #312

@natematykiewicz
Copy link
Contributor Author

I have signed the CLA!

Comment on lines +158 to +170
test "correctly handles attr_readonly" do
response = generate_document_symbols_for_source(<<~RUBY)
class FooModel < ApplicationRecord
attr_readonly :foo
end
RUBY

assert_equal(1, response.size)
assert_equal("FooModel", response[0].name)
assert_equal(1, response[0].children.size)
assert_equal("attr_readonly :foo", response[0].children[0].name)
end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure if you wanted this test. I see that has_one, has_many, has_and_belongs_to_many are all untested and just fall under the belongs_to test basically. So maybe this test isn't necessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it's not essential, but I'm ok with keeping it for now.

@KaanOzkan KaanOzkan requested review from a team, andyw8 and st0012 and removed request for KaanOzkan April 15, 2024 17:33
@andyw8 andyw8 added the enhancement New feature or request label Apr 15, 2024
@andyw8 andyw8 merged commit e7f10ea into Shopify:main Apr 15, 2024
28 checks passed
@natematykiewicz natematykiewicz deleted the nate/attr_readonly_symbol branch April 16, 2024 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recognize attr_readonly as symbol
2 participants