Skip to content

🌈The klass parameter 'inject_into_class' should be given a string type.(also inject_into_module)#752

Merged
rafaelfranca merged 1 commit into
rails:masterfrom
ratovia:change-comment-inject_into
May 27, 2021
Merged

🌈The klass parameter 'inject_into_class' should be given a string type.(also inject_into_module)#752
rafaelfranca merged 1 commit into
rails:masterfrom
ratovia:change-comment-inject_into

Conversation

@ratovia

@ratovia ratovia commented Apr 13, 2021

Copy link
Copy Markdown
Contributor

I think that in most cases the target klass is not defined in a file that uses inject_into_class.
So it is more friendly to set the default comment to string type.
as-is

inject_into_class "xxx.rb", ApplicationController, "Lorem"

to-be

inject_into_class "xxx.rb", "ApplicationController", "Lorem"

I think it's more realistic for test specs to delete the empty class definition in the first line.
Also about the inject_into_module.

@ratovia ratovia changed the title The klass parameter 'inject_into_class' should be given a string type.(also inject_into_module) 🌈The klass parameter 'inject_into_class' should be given a string type.(also inject_into_module) Apr 13, 2021
@xjunior

xjunior commented May 26, 2021

Copy link
Copy Markdown

Looks good, but I think it's better if both are allowed. Since the implementation already allows that, you could just add another test to make sure strings are also supported. And +1 to update the docs.

@rafaelfranca

Copy link
Copy Markdown
Member

That works by "mistake" today and I prefer if we don't advertise it. I'll merge this as-is

@rafaelfranca rafaelfranca merged commit 2d25975 into rails:master May 27, 2021
Sign up for free to 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.

3 participants