Machinist blueprints do not work with a column :display
This didn't work for me. Seems display
is already taken in Machinist
.
# in spec/support/blueprints.rb
Partner.blueprint do
company_name
display { true }
end
Related cards:
Machinist blueprints: Do not set associations without blocks
TL;DR In blueprints, always wrap associations in blocks.
# Broken
Task.blueprint(:vacation) do
project Project.make(:vacation)
hours 8
accounting_method 'none'
end
# Correct
Task.blueprint(:vacation) do
project { Project....
Do not use "flex: 1" or "flex-basis: 0" inside "flex-direction: column" when you need to support IE11
Flexbox is awesome. Most of it even works in IE11, but flex: 1
won't work reliably in Internet Explorer.
This it because implicitly sets flex-basis: 0
which IE fails to support properly.
Example
Consider the following HTML and CSS.
<...
Machinist: Refer to another named blueprint inside a blueprint
Note: We are talking about Machinist 1 here, Machinist 2 may have solved this or might require a different approach.
Machinist allows named bluep...
PostgreSQL: "WHERE NOT <column> = '<value>'" statements do not include NULL values
Sometimes we write plain SQL queries in migrations so we don't have to mock ActiveRecord classes. These two migrations do the same:
class Migration1 < ActiveRecord::Migration[5.2]
class User < ActiveRecord::Base; end
def up
add_c...
What collapsing margins are, how they work and when margins do not collapse
Imagine you have 2 HTML boxes. The first one has a margin-bottom
of let's say 30px
and the second one a margin-top
of 20px
. After rules of collapsing margins have been applied we ha...
How to make a cucumber test work with multiple browser sessions
Imagine you want to write a cucumber test for a user-to-user chat. To do this, you need the test to work with several browser sessions, logged in as separate users, at the same time.
Luckily, Capybara makes this relatively easy:
Scenario:
S...
Sudo a gem executable does not work on Ubuntu
Today I needed to execute a ruby gem executable with sudo
. But, surprisingly, bash would tell me command not found
for the gem that ran lovely without sudo
.
Gem bin
s are installed to /var/lib/gems/1.8/bin
, which is not in sudo’s PATH
....
Bugfix: Rails 2 does not find an association when it is named with a string instead of a symbol
Association named 'variations' was not found; perhaps you misspelled it?
I just was hunting down a strange error with this model:
class Model
placeholder = 'variations'
has_many placeholder
nested_scope :v...
Firefox: Focus-sensitive Selenium tests do not work reliably in parallel test execution
This is a problem when using Selenium with Firefox. We recommend using ChromeDriver for your Selenium tests.
Firefox will not trigger focus/blur events when its window is not focused. While this makes sense in standard usage, it...
Don't sum up columns with + in a SQL query if NULL-values can be present.
Don't sum up columns with +
in a sql-query if NULL
-Values can be present.
MySQL and PostgreSQL cannot sum up NULL
values with the +
value. The sum value will be NULL
.
MySQL:
mysql> select 1 + 2 + 3;
+-----------+
| 1 + 2 + 3 |
+--...