You can find ActiveRecord models by using a Range as its conditions: User.scoped(:conditions => { :id => 3..5 }) This will generate...
If you have the following deprecation warning after upgrading to rails >= 2.3.10 DEPRECATION WARNING: The :overwrite_params option is deprecated...
You will occasionally need to clean out your database while keeping the schema intact, e.g. when someone inserted data in...
jQuery offers many different methods to move a selection through the DOM tree. These are the most important: $element.find(selector...
When you set both a record's association and that association's foreign key attribute, Rails does not realize you...
If you have content inside a page that is hidden by CSS, the following will work with Selenium, but not...
Sometimes you might want to know if an attribute is an associated object or a simple string, integer etc. You...
MySQL's MIN and MAX functions are for aggregations only. This will not work and produce an error:
Note: For PostgreSQL you should use advisory locks. For MySQL we still recommend the solution in this card.
Paperclip uses the imagemagick resize options like 100x50> , 100x50<, 100x50# etc to resize images. See the link what options are...
When you have a Cucumber step like Then I should see "Did you see those \"quotation marks\" over there...
This note is a reminder that there is something called AppArmor that could cause weird errors ("File not found", "Can...
On 32bit systems, the maximum representable Time is 2038-01-19 03:14:07 in UTC or 2038-01-19...
Have a backup. Stop MySQL: sudo service mysql stop Move (or copy) your mysql directory. If you want /mnt/mysql to...
This tool is used on our application servers (and called when deploying) but it also works locally. Just call dumple...
To test whether two arrays have the same elements regardless of order, you can use the =~ matcher in RSpec < 2.11...
Note that this sounds good but is not good at all when hooking tasks on cap deploy (see this article...
This note describes a Cucumber step definition that lets you say: Then "Mow lawn" should be an option for "Activity...
When you try to remove a non-existing index using remove_index, the migration will incorrectly pass without an error...
jQuery plugin to register callback functions to keyboard shortkuts. Keyboard events in vanilla Javascripts are super-painful to work with...
A check if two date or time ranges A and B overlap needs to cover a lot of cases:
Note: Consider not doing this. Use form models or vanilla methods instead. The :conditions option for Rails associations cannot take...
The difference between .bind(), .live(), and .delegate() is not always apparent. Having a clear understanding of all the differences, though...
Sometimes it is useful to define a named scope by implementing a static method with the scope's name on...