RSS

Sam Schenkman-Moore's code snips

Jun 03
Apr 26
Mar 12
Mar 10
Mar 05

Basic Ruby Module behavior, class methods and instance methods for the implementing class.

class ImplementingModule
include SampleModule
end

ImplementingModule.class_method_one # hi, class method here
ImplementingModule.new.instance_method_one # howdy do, instance method here

Mar 04

An array of id values in order into an array of ActiveRecord objects in order (one query)


I originally did this using enumerable’s “find”, but “detect” is the exact same method and doesn’t carry the same ActiveRecord baggage.