Skip to main content


Showing posts from June, 2015

Source Location, i.e. Where the heck is this method defined?

Just a short one for now.

Most of the time, if you are working on a well defined project, it's pretty easy to find where a function is if you want to change/tweak it. You can look in the class where it is defined and/or see if there are any mixins or decorators.

Sometimes, it can be downright impossible to tell.

Enter source_location

Fire up your rails console and put in the following (for a class method :search on User)


if you have an instance method

This should give you something like the following

This should at least give you some idea of what is going on...

Mixins in ES6

I had been looking for a good way to do mixins in ES6.

Looks like I finally found one.


create the mixin as a const

Use Object.assign to add the properties to the Class