...Gemfile.lock carefully when submitting a commit. Note that the approach in this card works best, if you use bundle outdated together with bundle update some_gem --convervative for major updates...

...methods for calculating times and dates, like Duration#ago or Duration#from_now. But beware when using those, because they wont give you Dates or Times but ActiveSupport::TimeWithZone instances...

...your local timezone, but Rails.application.config.time_zone, which has UTC as default value. The mitigation Best case, you have already defined Rails.application.config.time_zone, as we recommend anyway. In this case you...

edgeapi.rubyonrails.org

The linked article suggests an interesting way to speed up tests of Rails + Postgres apps: PostgreSQL allows the creation of...

makandra dev

Today I got a better understanding of how git works, in particular what git checkout and git reset do. Git basics A commit holds a certain state of a directory...

Working with a self-signed certificate is much easier, when the browser accepts it. Google Chrome Warnings from chrome might...

makandracards.com

...accept both optional and keyword arguments is dangerous and should be avoided. This confusing behavior will be deprecated in Ruby 2.7 and removed in Ruby 3, but right now you...

end end colored_p(User.new) # ArgumentError: unknown keywords: first_name, last_name This behavior is not very smart. The easy fix is just to never mix optional and keyword...

By default, Devise sends all emails synchronously with deliver_now. To change that, Devise's readme suggests overwriting the send...

github.com

Setting array columns When using PostgreSQL array columns, you can set an array attribute to a value with square brackets...

simple_format ignores Rails' XSS protection. Even when called with an unsafe string, HTML characters will not be escaped or...

georgemauer.net

If your application exports CSV, be advised that Excel and other spreadsheet applications treat certain cells (those starting with =, +, - or...

jetbrains.com

In RubyMine folders can be excluded from search, navigation etc. by marking it as excluded. You might sometimes wish to...

...not do that and if everything was fine before, maybe just restore the previous behavior by adding environment.loaders.delete('nodeModules') to your environment.js. If you used postcss-cssnext before, add it...

keepachangelog.com

People do. Whether consumers or developers, the end users of software are human beings who care about what's in the software. When the software changes, people want to...

Sometimes I ran across a GitHub merge request of a gem where it was not completely obvious in which version...

...equal $my-great-blue instead of blue. The reason is that custom property values behave differently and allow any kind of value to be assigned (thus not being bound to...

...of a datepicker or just the english one. Most often you want to import beside the default JS defined in the package.json the styles of the library.

makandra dev

...be aware of its security implications. Both variants have options to change their default behaviour. Search engines and redirects If you have a public facing website that ranks on search...

adactio.com

...their expected input (e.g. username, email, current-password, cc-number), browsers can offer a better autocomplete experience. There's a host of possible values. Try it live! Better Mobile Inputs...

developer.mozilla.org

...I've seen examples using directory but there are no indications this attribute will become standard soon. Feel free to use to feel future-proof. On JavaScript file objects, webkitRelativePath...

When deploying Rails applications you might have noticed that JS and CSS are not cached by all browsers.

One of the many useful features of TextMate is autocompletion of words. If I were in TextMate right now, I...

jakearchibald.com

The way that Javascript schedules timeouts and promise callbacks is more complicated than you think. This can be the reason...

Testing file download links in an end-to-end test can be painful, especially with Selenium. The attached download_helpers.rb provides...

makandra dev

If you're frequently switching between projects, you might be annoyed by RubyMines behavior of opening the last project on startup. After all loading a project takes a few seconds...

...a dialog to choose the project to open. This can be set under Appearance & Behavior > System Settings > Project > Reopen projects on startup. Switching to other projects A helpful dialog for...