Code Monkey home page Code Monkey logo

guides's People

Contributors

gomorizsolt avatar thisismydesign avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

guides's Issues

Add Rails best practice around migrations and seeds

https://stackoverflow.com/a/2667747/2771889

avoid seeding in migrations. if you change the model (e.g. add a mandatory field) old migrations will no longer work. either you'd have to update existing migrations, which is ill-advised ("In general, editing existing migrations is not a good idea." https://edgeguides.rubyonrails.org/active_record_migrations.html#changing-existing-migrations), or avoid db:migrate(:*) in favor of db:schema:load.

avoid bin/rails db:create db:migrate && bin/rails db:seed

e.g. if there's a non-optional relation added to an initializer that used to be optional before

UI text / wording guideline

A guide on UI text / wording would be nice. I'd prefer that we find and re-use some exiting reputable guide. Would only start deciding on our own as a last resort because it's a fairly contentious topic.

E.g. whether to use sorry and please is usually a topic of discussion.

Sorry, something went wrong. Please try again later.

vs

Something went wrong. Try again later.

Other topics:

  • capitalization of text
  • tone
  • pronouns
  • etc

Improve request-response cycle with axios

Originally created by @gomorizsolt

We often use node-fetch. It does seem axios is much more suitable for client- & and server-side promise-based requests. Looking at its configuration, it's highly customizable and has several advantages as opposed to the (built-in) fetch library, e.g.:

We can also attach an adapter to axios so that the responses are cached in-memory for the given time(see #243).

Revise GL CI parallelization and dependencies

So if I understand it correctly we should have the following stages and jobs:

stages:
  - verification
  - deploy

lint:
  stage: verification

test:
  stage: verification

apiary-validate:
  stage: verification

code-quality:
  stage: verification

heroku-deploy:
  stage: deploy

gl-pages-deploy:
  stage: deploy

apiary-deploy:
  stage: deploy

This would result in maximum parallelization while making sure deploys only run if verifications are successful.

Social media chapter

Here's how far I got:

You may be tasked to engage social media. E.g. addressing user feedback, raising awareness, doing market research, creating publications, etc.

Instead of managing company-accounts or other forms of public facades we encourage you as individuals to deliver the message with your own unique touch.

We stand behind your professionality but also mandate it. The account you're using for this purpose must project a professional persona.

I'm not very happy with the wording of the last part but couldn't come up with anything better. Ideas appreciated on the existing part as well as whether we should include something else?

Add chapter to Rails about first_or_create & co

Initial notes:

Keep in mind caveats of first_or_create, find_or_create_by, first_or_initialize, find_or_initialize_by and upsert

where and first_or_* can be combined to be the same as find_or_*_by

User.where(name: "Roger").first_or_initialize == User.find_or_initialize_by(name: "Roger")
User.where(name: "Roger").first_or_create == User.find_or_create_by(name: "Roger")

The body only runs if the object is newly created

User.where(id: id).first_or_create! do |user|
  user.assign_attributes(attributes)
end

User.find_or_create_by!(id: id) do |user|
  user.assign_attributes(attributes)
end

User.where(id: id).first_or_initialize do |user|
  user.assign_attributes(attributes)
  user.save!
end

User.find_or_initialize_by(id: id) do |user|
  user.assign_attributes(attributes)
  user.save!
end

Passed attributes are only assigned if the object is newly created

User.where(id: id).first_or_create!(attributes)
User.where(id: id).first_or_initialize(attributes)

find_or_create_by(nil) will get the first entity while find_or_create_by(id: nil) will create a new one

User.find_or_create_by(nil) != User.find_or_create_by(id: nil)

Valid but broken?

User.where(id: id).find_or_initialize_by

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.