In RSpec 2 shared_examples_for can have parameters. You can simply hand over arguments from it_behaves...

When you eagerly load an association list using the .include option, and at the same time have a .where on...

RSpec 1, RSpec 2 To test whether two arrays have the same elements regardless of order, RSpec 1 and 2...

When using an odd value for line-height in CSS the result will vary across all major browsers.\

To only run the next two migrations: rake db:migrate STEP=2 To revert the previous two migrations:

alfajango.com

Thanks to habits engrained by Rails 2’s link_to_remote and remote_form_for, we expect that Rails 3...

You will need to upgrade to RSpec >= 2 and rspec-rails >= 2 for Rails 3. Here are some hints to...

If you previously used version 2.x of Thunderbird and upgraded to 3.x (for example through an Ubuntu release...

If you need to look at the list of methods that are called upon certain events (like before/after saving etc...

Note: We are talking about Machinist 1 here, Machinist 2 may have solved this or might require a different approach...

makandra dev

If you have problems with SSH session timing out, add the following to your /etc/.ssh/config: Host * ServerAliveInterval 55 ServerAliveCountMax 2

You can use record.send(:update_without_callbacks) or record.send(:create_without_callbacks) This can be used as a...

Find conditions for scopes can be given either as an array (:conditions => ['state = ?', 'draft']) or a hash (:conditions => { 'state' => 'draft...

There are many different methods that allow mapping an Array to a Hash in Ruby. Array#to_h with a...

When Paperclip attachments should only be downloadable for selected users, there are three ways to go. The same applies to...

You should test the callback methods and its correct invocation in two separate tests. Understand the ActiveRecord note before you...

github.com

By default, Cucumber uses mocha. This note shows to use RSpec stubs and mocks instead. Rspec 1 / Rails 2

makandra dev

sudo apt-get install i8kutils Reboot You can now run the i8k tools such as i8kmon Setting the fan speed...

Rails 3, 4, 5, 6 config/application.rb config/environment.rb before the initialize! call (we don't usually edit this file)

github.com

There are three ways to define your own RSpec matchers, with increasing complexibility and options: 1) Use RSpec::Matchers.define

nickstakenburg.com

Prototip allows you to easily create both simple and complex tooltips using the Prototype javascript framework. Please note: "Permission to...

When working with times and dates in Rails applications, you need to deal with the following problem: In Rails, Time...

regular-expressions.info

You can write regular expressions some different ways, e.g. /regex/ and %r{regex}. For examples, look here. Remember that it...

So you screwed up and copied Paperclip secrets from one project to another. Here is a semi-automatic, painful way...