Conversation
…dd `config.debug`
c19c6f9 to
a27461d
Compare
|
Tests added. |
| backticks = '# ```' | ||
| annotation.unshift(backticks).push(backticks) | ||
|
|
||
| if annotation.first.start_with?("# create_table") |
There was a problem hiding this comment.
@Morozzzko will this work for views, or we need something like annotation.first.start_with?("# create_table") || annotation.first.start_with?("# create_view")? Can you tell us how the views look like in your app's annotations?
There was a problem hiding this comment.
I'll check and tell you by Tuesday evening
There was a problem hiding this comment.
Sorry I'm late. It says create_table even if it's a view
Probably because it's a materialized view, not sure
create_table :table_name id: false, force: :cascade do |t|
| end | ||
|
|
||
| @lines.unshift(*annotation, nil) | ||
| elsif configurator.debug |
There was a problem hiding this comment.
I think this should be
| elsif configurator.debug | |
| elsif configurator.debug? |
| let(:configurator) { | ||
| c = ActiveRecord::Annotate::Configurator.new | ||
| c.debug = true | ||
| c |
There was a problem hiding this comment.
This can be simplified to ActiveRecord::Annotate::Configurator.new.tap { |c| c.debug = true }.
| expect(new_file).not_to be_changed | ||
| end | ||
| end | ||
|
|
| ### Doesnt add new annotation to non-annotated file | ||
| new_file.annotate_with(["error"], configurator) | ||
| expect(new_file).not_to be_changed | ||
| end |
There was a problem hiding this comment.
I don't get the idea of this test. You are re-annotating the file with the same annotation and then checking that it didn't change :) Also the title assumes that old annotation should get removed which is not what happens here.
|
I have some other more important tasks on the go and you seem to have lots of comments and insight. Do you have any interest in picking up this PR and finishing it? |
Solves #11
config.debug = trueto puts errorsNote: this is untested so far I merely wrote it.