Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Annotate model options:
--without-comment exclude database comments in model annotations
--with-column-comments include column comments in model annotations
--without-column-comments exclude column comments in model annotations
--position-of-column-comments [with_name|rightmost_column]
--position-of-column-comment [with_name|rightmost_column]
set the position, in the annotation block, of the column comment
--with-table-comments include table comments in model annotations
--without-table-comments exclude table comments in model annotations
Expand Down
4 changes: 2 additions & 2 deletions lib/annotate_rb/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ def add_model_options_to_parser(option_parser)
@options[:with_column_comments] = false
end

option_parser.on("--position-of-column-comments [with_name|rightmost_column]",
option_parser.on("--position-of-column-comment [with_name|rightmost_column]",
"set the position, in the annotation block, of the column comment") do |value|
@options[:position_of_column_comments] = value.to_sym
@options[:position_of_column_comment] = value.to_sym
end

option_parser.on("--with-table-comments",
Expand Down
6 changes: 3 additions & 3 deletions spec/lib/annotate_rb/parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -591,13 +591,13 @@ module AnnotateRb # rubocop:disable Metrics/ModuleLength
end
end

describe "--position-of-column-comments" do
let(:option) { "--position-of-column-comments" }
describe "--position-of-column-comment" do
let(:option) { "--position-of-column-comment" }
let(:values) { "rightmost_column" }
let(:args) { [option, values] }

it "sets with_column_comments to true" do
expect(result).to include(position_of_column_comments: :rightmost_column)
expect(result).to include(position_of_column_comment: :rightmost_column)
end
end

Expand Down