...of workers to 1 and the other requests have to wait. UNICORN_WORKERS=1 rails server

Observed on Rails 2.3 and machinist 1.0.6 Like the title says, when you define the method empty? like in the following example, you may not longer use collection.make.

dev.mysql.com

...point. A DECIMAL(6,2) column may store numbers up to 9,999.99. In Rails, a decimal column definition looks like this: t.decimal :amount, :precision => 6, :scale => 2. Issue

If you have the following deprecation warning after upgrading to rails >= 2.3.10 DEPRECATION WARNING: The :overwrite_params option is deprecated. Specify all the necessary parameters instead. that is for example...

makandra dev

Consider the following HTML & CSS: ^ img { background-color: red; } div { border: 1px solid black; } This will leave a margin of...

...data in columns. This is helpful for e.g. comparing attributes of a set of Rails records. def tp(objects, *method_names) terminal_width = `tput cols`.to_i cols = objects.count...

To simulate Rails' to_sentence in your JavaScript application, you can use these few lines of CoffeeScript code: joinSentence = (array) -> if array.length > 1 array[0..-2].join(', ') + ', and ' + array...

...you don't have a route that responds to /__identify, Capybara will wrap your Rails app in a middleware that responds to that path...

...staging or production environments, chances are that JavaScript compression is the culprit. By default, Rails 3.2 compresses JavaScript with UglifyJS. I have seen a few cases where this actually breaks...

...to check all traits for mistakes. This behavior is likely to be caused by Rails' autoloading...

Also compare our card Test if two date ranges overlap in Ruby or Rails...

makandra dev

...the gem. The gem is there for you should you one day upgrade to Rails 3.2+. Please don't use the defaults gem which we original forked away from in...

...once again and check for such things thoroughly before heading into the depths of Rails or your application's logic...

...disabled, that all classes are already loaded when browser interaction takes place what makes rails able to find the class even without the namespace...

...for features. If you don't have separate environments, you can't check your Rails.env. I managed to distinguish between specs and features by asking Capybara. Note that this only...

Sometimes the Rails helper #distance_of_time_in_words is using too much magic. When you need a time difference in a specific unit, use this method: ^ def distance_of...

...to iterate over every Monday in a range of Dates. If you are using Rails or ActiveSupport, calling step without a block will return an array of matching elements...

...but completely different card: Detect if a Javascript is running under Selenium WebDriver (with Rails...

Rails doesn't know which host it is running on. For generating links, it strips the hostname off the request URL, which can lead to errors when you have absolute...

Ruby 1.8 (supplied by Rails' ActiveSupport) >> BigDecimal.new("0.1").floor.class => BigDecimal Ruby 1.9 (supplied by Ruby 1.9 itself) >> BigDecimal.new("0.1").floor.class => Fixnum In fact, Float#floor has changed from Ruby1.8 to...

...or by setting self.primary_key = "id" in your class definition. Related, but different issue: Rails 2 does not find an association when it is named with a string instead of...

...let pages pop up as errors occur), the capybara-20120326132013.html files will clutter up your Rails root directory. To tell Capybara where it should save those files instead, put this into...

Then I should see "Welcome!" What happens here is that the Rails application serving pages runs in 2017, but the process running your browser still lives today...

makandra dev

When a Rails controller action should handle both HTML and JSON responses, do not use request.xhr? to decide that. Use respond_to. I've too often seen code like this...