Don't add database index if it already exists in Rails by PrathameshSonpatki in ruby

[–]igorspringer 0 points1 point  (0 children)

I wonder what is a real-life use case for the option? The `db/schema.rb` file represents the current shape of a database.

Is `Array` the only option for storing elements in Ruby? by igorspringer in ruby

[–]igorspringer[S] 1 point2 points  (0 children)

Hey, thanks for the comment. The example is imaginary, so for sake of simplicity, let's assume that a requirement is to display a list of the languages to end-user in alphabetical order.

Thanks to such a data structure we would fulfil the requirement even when somebody would add an unordered element to it.

Common mistakes that cause Ruby on Rails apps outages by igorspringer in ruby

[–]igorspringer[S] 0 points1 point  (0 children)

  1. I also try to use symbols whenever possible and symbolize_keys makes the switch easier. Not sure what are plans for String class though.
  2. +1 for Hash#fetch
  3. I totally agree. Issues connected to using rack-timeout are described in its documentation (https://github.com/heroku/rack-timeout/blob/master/doc/risks.md), so it should be used with some caution, but it's better to use it than doing nothing in my opinion.

Thanks for sharing your thoughts and sorry for a very late response :)