Use base_class. This traverses up the hierarchy until it encounters either a class inheriting from ActiveRecord::Base or

CTRL + SHIFT + ALT + N Search for any symbol in your application, like CSS classes, Ruby classes, methods, helpers etc...

Jasmine comes with two matchers that test for equality. The first is toBe: expect(first).toBe(second) toBe passes when...

The migration DSL now supports adding and removing foreign keys. They are dumped to schema.rb as well. At this time...

marcparadise.com

When you the following error: zsh: corrupt history file /home/marc/.zsh_history You can try and fix your history file by extracting...

leomayleomay.github.io

Your after_commit callbacks will not know about changes, as Rails discards them when committing. The linked article shows a...

makandra dev

This blew my mind today: 12 Little-Known CSS Facts 12 Little-Known CSS Facts (The Sequel) Please make sure...

nateberkopec.com

Very detailed guide to caching Ruby on Rails. Goes well with the official Rails guide on caching.

If you see a stacktrace beginning with lines like this: E, [2015-07-16T09:23:10.896146 #23308] ERROR -- : app...

If a SOAP API expects you to call a remote method with arguments of complex types, Savon lets you manually...

makandra dev
getmdl.io

CSS (+ some Javascript) framework, implementing Google's material design for static web pages. Can be used for plain websites without...

Disabling auto-complete in login forms is probably a bad idea, since it encourages weak passwords. If you are still...

In my RubyMine I have recorded two macros for debugging and linked them to some keyboard shortcuts. Since I believe...

Today I ran into this: Invalid gemspec in [/usr/local/rvm/gems/ruby-1.9.3-p194/specifications/ZenTest-4.9.3.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]. You need a newer Rubygems version. Try...

duri.me

Small web application where you can upload an image (PNG, JPEG, GIF) and generate a base64-encoded version of it...

Rails comes with grouped_collection_select that appears to be useful, but isn't. As an alternative, consider the flat...

github.com

When working with ActiveType you will often find it useful to cast an ActiveRecord instance to its extended ActiveType::Record...

Note: ActiveRecord::Base#becomes has a lot of quirks and inconsistent behavior. You probably want to use ActiveType.cast instead.

To disable the mostly useless automatic suggestion popups in RubyMine, go to File / Settings, then to Editor / General / Code Completion...

guides.rubyonrails.org

Starting from 4.1, Rails automatically detects the inverse of an association, based on heuristics. Unfortunately, it does not seem to...

Since version 2.6 exception notifier distinguishes between foreground and background sections. The reason is that with background jobs (e.g. methods...

devalot.com

Good article about ruby singleton classes.

api.rubyonrails.org

ActiveModel supplies an errors object that behaves similar to a Hash. It can be used to add errors to a...

Developing complex regular expressions quickly blows my mind. Here are some online regex editors that help you by highlighting matching...