Skip to content
WiktoriaRozanska edited this page Jun 6, 2023 · 1 revision

cias-api repo standards

It is recommended

  1. Read guidelines;
  2. Use an overcommit tool;
  3. Use ENVs;
  4. If you would like, you can run the app through the Docker. Rebuild the Docker system if you see in commit/PR changes:
    1. db/schema.rb;
    2. db/migrate/;
    3. Gemfile, Gemfile.lock.
  5. Method convention. In:
    1. Serializers:
      1. array - use prefix collect_;
      2. value - use prefix provide_.
    2. Controllers:
      1. collection - use suffix _scope;
      2. object - user suffix _load.

Branch

  1. Get issue title without b |:
    • text-to-speech (TTS) readjust logic.
  2. Execute on it parameterize.underscore:
    • 'text-to-speech (TTS) readjust logic'.parameterize.underscoretext_to_speech_tts_readjust_logic.
  3. Concat just issue ID with the result from point 2:
    • 280_text_to_speech_tts_readjust_logic.
  4. From master do $ git checkout -b CIAS-280_text_to_speech_tts_readjust_logic.

alter_payload_to_implement

This is a special branch where we hold commits with features which will be implemented in:

  • next iteration;
  • needed by other tasks;
  • not ready now;
  • placeholders;
  • not in current task scope but it'll be helpful in another task.

PR

  1. Title - concat ID issue with the title from Branch#1;
  2. Body - use provided placeholder.

Merging

  1. Always squash unless PR contains a lot of features, then squash but to fewer commits;
  2. Always rebase.

helpers

User in the console

$ bundle exec rails c

Create

u = User.new(email: '[email protected]', first_name: 'me', last_name: 'new', password: 'azerty', roles: ['admin'])
u.confirm
u.save(validate: false)

Update

u = User.find_by(email: '[email protected]')
u.password = 'azerty'
u.save(validate: false)