...supports standard Hash.new forms There's also a Concurrent::Cache class that sort of behaves like an unordered Hash, but is much faster. Info If you're using Rails you...
For some years Google Chrome has allowed you to add desktop icon for any web page by going to Tools...
...its internal state. It is usually sufficient to use the then() function. Where promiseState() becomes useful is when writing unit tests for a function that returns a promise.
Note: ActiveRecord::Base#becomes has a lot of quirks and inconsistent behavior. You probably want to use ActiveType.cast instead. This issue will be encountered when relying on attribute_was methods...
...model, for example. In my case a record with an assignable_values legacy value became invalid when it should not. The initializer in the attached file will fix this issue...
Normally you can list all gems of the current ruby version with gem list, which also includes the gems of...
FactoryBot allows to create traits from Enums since version 6.0.0 The automatic definition of traits for Active Record enum attributes...
...deployment output appear less noisy, it also hides information that could be helpful. I believe you should prefer knowing what is going on, even if causes a few extra lines...
To open a terminal quickly navigate to System → Preferences → Keyboard Shortcuts. There, click the "Run a terminal" row (It should...
We have projects that have been developed using many different versions of Ruby. Since we do not want to...
When writing a Sass function, you may run into an error message that may be confusing: @function rules may not...
Run bundle update cucumber capybara cucumber-rails to update to the newest versions. Backup your features/support/path.rb to be able to...
...methods") would not be unstubbed before the next example, causing it to fail. This behavior can come and go as you edit your specs, since this can change the order...
...evaluates your .rb files. I was not able to find a fix for this behavior. Calling #rspec_reset und #unstub!(:method) on the class after the example did not help...
Sometimes you want to preload images that you will be using later. E.g. if hovering over a an area changes...
Sometimes you want to test migrations with production or staging data. Dumping single tables makes sense if a complete dump...
Did you know you can do in-place batch processing with plain ruby? The following script will in-place replace...
...forward than I had expected. And, it turns out Internet Explorer’s RFC-incompliant behaviour makes it safer to host your websites with a www-prefix, so www.mxsasha.eu instead of...
...them by spaces: /alertson KEYWORD1 KEYWORD2 Keywords are case-insensitive. To revert to standard behaviour, use simply /alertson List of Skype commands
The Capybara API is somewhat hard for parse for a list of methods you can call on a Capybara node...
The method cookies is defined in the ActionController and should never be overwritten. Bad example class StaticPagesController < ApplicationController
To read the Rails session from a Rack middleware, use env['rack.session']. It's an ActionDispatch::Request::Session object.
Simply add this to your .rspec instead: --require spec_helper If you are on rspec >= 3 and use a rails_helper.rb...
...cannot detect whether a browser will do something useful with a tel: link. Your best options seem to be: Don't have tel: links and rely on the mobile browsers...
If Sunspot does not work and fails with a backtrace similar to this: /project/shared/bundle/ruby/1.8/gems/rsolr-1.0.6/lib/rsolr/client.rb:227:in `adapt_response' /project/shared/bundle/ruby/1.8/gems/rsolr-1.0.6/lib/rsolr/client.rb:164...
Spreewald now comes with a step that tests if a form field is visible: Then the "Due date" field should...