Skip to content

Fix error: can't modify frozen String: "decimal" - #895

Merged
ctran merged 3 commits into
ctran:developfrom
n-rodriguez:wip/fix_frozen_strings
Apr 23, 2023
Merged

Fix error: can't modify frozen String: "decimal"#895
ctran merged 3 commits into
ctran:developfrom
n-rodriguez:wip/fix_frozen_strings

Conversation

@n-rodriguez

Copy link
Copy Markdown
Contributor

This PR fixes these errors due to the presence of # frozen_string_literal: true in files :

Unable to annotate app/models/camping.rb: can't modify frozen String: "decimal" /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:875:in `get_attributes'
/home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:151:in `block in get_schema_info' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:149:in `each' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:149:in `get_schema_info' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:481:in `annotate'
/home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:682:in `annotate_model_file' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:658:in `block in do_annotations' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:657:in `each' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:657:in `do_annotations'
/home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/tasks/annotate_models.rake:56:in `block in<main>'Unable to annotate app/models/camping.rb: no implicit conversion of nil into Array /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:682:in `concat' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:682:in `annotate_model_file' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:658:in `block in do_annotations'
/home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:657:in `each' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:657:in `do_annotations' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/tasks/annotate_models.rake:56:in `block in<main>'Unable to annotate app/models/camping_raw.rb: can't modify frozen String: "decimal"
/home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:875:in `get_attributes' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:151:in `block in get_schema_info' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:149:in `each' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:149:in `get_schema_info'
/home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:481:in `annotate' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:682:in `annotate_model_file' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:658:in `block in do_annotations' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:657:in `each'
/home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:657:in `do_annotations' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/tasks/annotate_models.rake:56:in `block in <main>'Unable to annotate app/models/camping_raw.rb: no implicit conversion of nil into Array /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:682:in `concat' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:682:in `annotate_model_file'
/home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:658:in `block in do_annotations' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:657:in `each' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:657:in `do_annotations' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/tasks/annotate_models.rake:56:in `block in <main>'
Unable to annotate app/models/user_profile.rb: can't modify frozen String: "decimal" /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:875:in `get_attributes'
/home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:151:in `block in get_schema_info' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:149:in `each' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:149:in `get_schema_info' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:481:in `annotate'
/home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:682:in `annotate_model_file' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:658:in `block in do_annotations' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:657:in `each' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:657:in `do_annotations'
/home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/tasks/annotate_models.rake:56:in `block in<main>'Unable to annotate app/models/user_profile.rb: no implicit conversion of nil into Array /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:682:in `concat' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:682:in `annotate_model_file' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:658:in `block in do_annotations'
/home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:657:in `each' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/annotate/annotate_models.rb:657:in `do_annotations' /home/nicolas/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/annotate_models-786394947c04/lib/tasks/annotate_models.rake:56:in `block in<main>'

@n-rodriguez

Copy link
Copy Markdown
ContributorAuthor

See #834

@n-rodriguez

Copy link
Copy Markdown
ContributorAuthor

hi there! any news?

@n-rodriguez

Copy link
Copy Markdown
ContributorAuthor

Hi there! Any change to get this merged?

@n-rodriguez

Copy link
Copy Markdown
ContributorAuthor

ping @ctran

@n-rodriguez

Copy link
Copy Markdown
ContributorAuthor

ping @ctran

About the failing specs : there must be some leaking states somewhere. Errors now appear because of #787.

@n-rodriguez

Copy link
Copy Markdown
ContributorAuthor

ping @ctran

@ctranctran self-assigned this Oct 24, 2022
@ctranctran added this to the v3.2.1 milestone Oct 24, 2022
@ctran

Copy link
Copy Markdown
Owner

I think there's something else causing the CI failures, not your changes. I've been trying to figure out where the problem lies but it's taking me some time since I've been away from this for some time.

@n-rodriguez

Copy link
Copy Markdown
ContributorAuthor

ping @ctran

@ctran

Copy link
Copy Markdown
Owner

Hi, the CI issue is now fixed on the develop branch. Did you rebase with the recent changes?

@ctran
ctran merged commit 3a78787 into ctran:developApr 23, 2023
@n-rodriguez

Copy link
Copy Markdown
ContributorAuthor

Thank you!

jimmynguyc pushed a commit to jimmynguyc/annotate_models that referenced this pull request Oct 29, 2025
thatsanicehat pushed a commit to Home-Chef-Tech/annotate_models that referenced this pull request Jun 12, 2026
Sign up for freeto 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

@n-rodriguez@ctran