Some TILs about programming, photography and other stuff.

Ruby on Rails

Configuraci贸n de PATH

export PATH="$PATH:/usr/share/rvm/bin/:/opt/Android/Sdk/platform-tools/:/home/adrian/.gem/ruby/2.7.0/bin"

As铆 茅 como te帽o actualmente o .bashrc.

Screenshot

Jekyll

Jekyll * Simple, blog-aware, static sites

Jekyll

Testing

Revisar estos posts:

RSpec vs Test::Unit in Rails

Difference between Unit::Test versus Rspec

What not to test in Rails?

Posibles problemas

Increasing the amount of inotify watchers

listen/README at master 路 guard/listen

Por que non se deben modificar migraci贸ns

Editing Existing Rails Migrations is a good idea?

Deshacer migraci贸ns (rollbacks) de migraci贸ns en espec铆fico

How to rollback just one step using rake db:migrate

Ver status de migrations (pendentes e executadas):

rake db:migrate:status

# Or (rails >= 5)

rails db:migrate:status

Roll back the most recent migration:

rake db:rollback

Roll back the n most recent migrations:

rake db:rollback STEP=n

Here's some more:

Cach茅 en local

Ao activar cach茅 en local pode dar lugar a excepci贸ns cando se fan cambios no c贸digo sen reiniciar o servidor:

Rails.cache.fetch exception: TypeError ( can't be referred to)

Migraci贸ns

change method

The change method is the primary way of writing migrations. It works for the majority of cases, where Active Record knows how to reverse the migration automatically.

馃憠 List of supported Methods

If you're going to need to use any other methods, you should use reversible or write the up and down methods instead of using the change method.

Never rescue Exception

If you rescue Exception, you will rescue every exception, including some like:

Rescue StandardError Instead and Custom Exceptions Should Inherit from StandardError.

馃憠 The Honeybadger Developer Blog