...t say is_a?(ActiveRecord::NamedScope::Scope) because that is no longer true in Rails 3 and also doesn't match unscoped ActiveRecord classes themselves (which we consider scopes for...

...remember to set your values with field=#{quoted_true} and field=#{quoted_false}. The Rails methods quoted_false and quoted_true return the correct boolean representations for your database...

...sub directories, make sure to add -r features to the standard Cucumber options. In Rails apps, Cucumber options are likely to be stored in config/cucumber.yml...

...won't notice it during development. But with caching active (on production or staging) Rails will write an empty all.js file without complaining...

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

makandra dev
bootswatch.com

...Sass and Less files, so the theme can easily be integrated into your usual Rails application. Implements only Bootstrap features which means that some Material stuff is missing, but also...

github.com

...outputs a Rack application which you can either serve standalone or mount into your Rails app...

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

This is what worked for me in a Rails 4: # JSON data as first argument, then parameters patch :update, { some: 'data' }.to_json, id: id, format: :json

makandra dev

Ruby 1.9.2 is very slow when loading files, especially starting Rails servers or running specs takes forever. Do yourself a favor and upgrade to...

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

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

If you specify different ports, you can run multiple local webricks with rails server --port=300X at the same time...

github.com

...Minidusen, which extracts those parts from Dusen. Minidusen is compatible with MySQL, PostgreSQL and Rails 3.2, 4.2 and 5.0. If you are looking for a full text indexing solution, we...

...Always convert to a symbol, otherwise you'll have all kinds of fun. Newer rails / activerecord (at least 5.2) will throw an association names must be a Symbol (ArgumentError) error...

makandra dev
stackoverflow.com

...your working directory that you cannot remove by either checkout, reset [--hard], stash, probably Rails' Spring is the culprit and not Bundler itself. Fix spring stop The author of the...

github.com

...for old IEs. Unfortunately, their auto-loading mechanism may not work properly on your Rails application due to the asset pipeline. They use FileAPI, so you could just include it...

makandra dev

assignable_values now supports Rails 4.1 and Ruby...

makandra dev
robots.thoughtbot.com

The Rails community has been abuzz with object-oriented programming, SOLID principles, laws, design patterns, and other principles, practices, and patterns. We’ve (re)discovered new tools and techniques to...

speakerdeck.com

Presentation about optimizing Ruby on Rails apps. From Nico Hagenburger (homify's lead frontend developer...

makandra dev
gist.github.com

When ActiveRecord child objects are autosaved in Rails...

makandra dev
databound.me

Databound provides Javascript a simple API to the Ruby on Rails CRUD. Tries to expose a full model CRUD as an API. Not sure if this is useful for more...

makandra dev
github.com

Now supports Rails 4.1 and Ruby...

makandra dev
robots.thoughtbot.com

Rails 4.0 introduced a helpful new method for ActiveRecord queries: where.not. It can make clunky queries easier to read...