Learn how Ruby (Rails) investigates available options.

Asked 2 years ago, Updated 2 years ago, 80 views

Thank you for your help.

I used to maintain Java software.
We are currently working on development using Ruby on Rails.

In method arguments, I believe that the use of hash to specify variable length options is a feature of Ruby on Rails.
Is it possible to display a list of options that can be specified (what is expected to be specified)?
I guess I have no choice but to read it out of reference.

I would appreciate it if you could let me know in order to shorten the survey time.

Regarding the problem that is currently being solved, the reason for the above consultation is roughly as follows.

  • Requires additional columns containing comments to the DB that is currently running.
  • New migration file output.(Using railsg migration AddTo~)
  • A method called add_column was generated, but I don't know how to add comments.
  • I searched online, but I couldn't find the wisdom of my predecessor.
  • After a rough look at the source code, we found a definition that contained comments.
  • But I didn't know exactly how to specify it
  • I simply added comment: "***" to the end, and it was reflected in migration.

ruby-on-rails ruby

2022-09-30 21:39

1 Answers

The official version of the api document in rails can be found at the following site:

https://api.rubyonrails.org/

As for the add_column this time, when I searched from above, I found the next page, and I was wondering if I could also refer to the description of the comment option.

https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_column


2022-09-30 21:39

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.