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

Unable to annotate <model> : can't modify frozen String: "decimal" #834

Closed
n-rodriguez opened this issue Sep 6, 2020 · 3 comments
Closed
Assignees
Labels
Milestone

Comments

@n-rodriguez
Copy link
Contributor

n-rodriguez commented Sep 6, 2020

Describe your problem here.

Commands

nicolas@laptop:~/PROJECTS/concerto$ bin/annotate
Unable to annotate app/models/camping_raw.rb: can't modify frozen String: "decimal"
	/home/nicolas/.anyenv/envs/rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/annotate-3.1.1/lib/annotate/annotate_models.rb:259:in `block in get_schema_info'
	/home/nicolas/.anyenv/envs/rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/annotate-3.1.1/lib/annotate/annotate_models.rb:250:in `each'
	/home/nicolas/.anyenv/envs/rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/annotate-3.1.1/lib/annotate/annotate_models.rb:250:in `get_schema_info'
	/home/nicolas/.anyenv/envs/rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/annotate-3.1.1/lib/annotate/annotate_models.rb:621:in `annotate'
	/home/nicolas/.anyenv/envs/rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/annotate-3.1.1/lib/annotate/annotate_models.rb:818:in `annotate_model_file'
	/home/nicolas/.anyenv/envs/rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/annotate-3.1.1/lib/annotate/annotate_models.rb:794:in `block in do_annotations'
	/home/nicolas/.anyenv/envs/rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/annotate-3.1.1/lib/annotate/annotate_models.rb:793:in `each'
	/home/nicolas/.anyenv/envs/rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/annotate-3.1.1/lib/annotate/annotate_models.rb:793:in `do_annotations'
	/home/nicolas/.anyenv/envs/rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/annotate-3.1.1/bin/annotate:31:in `<top (required)>'
	bin/annotate:29:in `load'
	bin/annotate:29:in `<main>'

Version

  • annotate annotate-3.1.1
  • rails 6.0.3.2
  • ruby 2.7.1
@n-rodriguez n-rodriguez changed the title Unable to annotate <mode> : can't modify frozen String: "decimal" Unable to annotate <model> : can't modify frozen String: "decimal" Sep 21, 2020
@choilive
Copy link

Do you have # frozen_string_literal: true at the top of camping_raw.rb or the migration file with the create table..?

@n-rodriguez
Copy link
Contributor Author

Yes

@choilive
Copy link

Yeah, thats why you're getting the error, it doesnt appear that this gem is string literal friendly, should work if you remove the frozen string literal line.

ctran pushed a commit that referenced this issue Apr 23, 2023
@ctran ctran self-assigned this Apr 23, 2023
@ctran ctran added the bug label Apr 23, 2023
@ctran ctran added this to the v3.2.1 milestone Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants