class ActiveRecord::Base
Public Class Methods
[](input)
click to toggle source
# File lib/activerecord_squared/activerecord_ext.rb, line 3 def self.[](input) case input when nil # Specifically enables ```SomeModel[nil]``` to not error out. return nil when ::Hash return self.where(input) else return self.find(input) end end