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

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...

The bin/webpack-dev-server command is not as smart as e.g. rails server, where it shows the proper fix within the error message. $ bin/webpack-dev-server yarn run v1.19.1 error Command "webpack-dev-server...

...might get the above error message when cloning certain git repositories (for example the rails repository). It indicates that there is a malformed timestamp in some commit, and your git...

medium.com

...the poor decisions made at every turn. “Why, oh why, is this built with Rails when Node.js would be so much better?” or “how could the previous developer not have...

...Windows VM copies them over a Samba share onto your machine. From inside your Rails project directory call regularly: geordi remove-executable-flags Runs chmod -x on Ruby, HTML, CSS...

...joins, ActiveRecord will make that record read-only. This is a protective measure by Rails because such a record might have some additional attributes that don't correspond to actual...

In Rails, you can very easily send emails with HTML and plaintext bodies. However, if you're trying to debug those using your normal email account, you might be out...

stackoverflow.com

...to whatever you like (by returning old_value you'd get the behavior of Rails' reverse_merge!, by returning new_value you'd get the behavior of standard merge!).

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

lambie.org

...get it working, based off some useful instructions that are tailored for Ruby on Rails...

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...

github.com

better_errors is an awesome gem for enhanced error pages in development, featuring a live-REPL for some light debugging...

When your model is using a callback like before_save or before_validation to calculate an aggregated value from its...

...User.any_instance.stub(...) Note: You won't have RSpec 2.6 if you're still working on Rails...

...method and must have that CONSTANT there. Master mode is for you. Master mode (Rails 2) Put the attached file into your spec directory, then merge these lines into your...

...constant "CRAWL_SUBPAGES", false.\ Note: the constant must be given as String. Master mode (Rails 3) In Rails 3 applications you should prefer to set configuration options in Rails.configuration, which...

stackoverflow.com

...but does not break on empty arrays. Note that try is provided by ActiveSupport (Rails). You could explicitly load activesupport or use andand on plain Ruby...

Whenever is a Ruby gem that provides a nicer syntax for writing and deploying cron jobs. Leading zeros are important...

I recently browsed through the ActiveSupport code and found some nice stuff I did not know about: ActiveSupport::Callbacks

...when you come back to the console later Calls RSpec 1 (spec) in a Rails 2 project and RSpec 2 (rspec) in a Rails 3 project Configures RSpec to use...

objectmentor.com

What you can do today. Example AOP-isms in Ruby on Rails. Aspect-Oriented Design. The AOP Promise for Tomorrow...

gem 'guard', '=1.8.1' gem 'guard-livereload', '=1.4.0', :require => false Notes for Rails 2.3 projects On Rails 2.3, you need to add the middleware like this: # config/environments/development.rb

...that is set to true when in test mode: class ExampleController < BaseController SKIP_CAPTCHA = Rails.env.test? ... Next, depend activation of that feature on the value of that constant: private

FactoryBot.define do factory :parent do transient do child_name nil child_allowed_to_drive false end child do association(:child...