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

Fix create_table with multi t columns for Rails/SchemaComment #1042

Merged

Conversation

nipe0324
Copy link
Contributor

@nipe0324 nipe0324 commented Jul 3, 2023

This PR is fix no offenses for Rails/SchemaComment.

# create_table` with multi `t` columns 
create_table :users, comment: 'Table' do |t|
  t.integer :column1 # <- no offenses this line
  t.integer :column2 # <- also no offenses this line
end

Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.
  • If this is a new cop, consider making a corresponding update to the Rails Style Guide.

@nipe0324 nipe0324 force-pushed the fix-schema-comment-with-multi-t-column branch from 7565c92 to bb66f21 Compare July 3, 2023 14:21
^^^^^^^^^^^^^^^^^^^^^^^^^^ New database column without `comment`.
t.column :column1, :integer, comment: 'I am a first column'
t.column :column2, :integer
^^^^^^^^^^^^^^^^^^^^^^^^^^^ New database column without `comment`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you write a new test case without directly editing the existing test case?

Copy link
Contributor Author

@nipe0324 nipe0324 Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I wrote two new test cases.

^^^^^^^^^^^^^^^^^ New database column without `comment`.
t.integer :column1, comment: 'I am a first column'
t.integer :column2
^^^^^^^^^^^^^^^^^^ New database column without `comment`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

@nipe0324 nipe0324 requested a review from koic July 24, 2023 16:18
@koic
Copy link
Member

koic commented Jul 28, 2023

@nipe0324 This looks good to me. Can you squash your commits into one?

@nipe0324 nipe0324 force-pushed the fix-schema-comment-with-multi-t-column branch from 2cca970 to 91e2e3e Compare July 28, 2023 23:28
@nipe0324
Copy link
Contributor Author

@koic Ok, I have squashed my commits into one.

@koic koic merged commit 34376e0 into rubocop:master Jul 29, 2023
10 checks passed
@koic
Copy link
Member

koic commented Jul 29, 2023

Thanks!

@nipe0324 nipe0324 deleted the fix-schema-comment-with-multi-t-column branch July 30, 2023 02:55
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.

None yet

2 participants