Method: ActiveRecord::ClassMethods#method_missing

Defined in:
lib/reactive_record/active_record/class_methods.rb

#method_missing(name, *args, &block) ⇒ Object



141
142
143
144
145
146
147
# File 'lib/reactive_record/active_record/class_methods.rb', line 141

def method_missing(name, *args, &block)
  if args.count == 1 && name =~ /^find_by_/ && !block
    find_by(name.gsub(/^find_by_/, "") => args[0])
  elsif !SERVER_METHODS.include?(name)
    raise "#{self.name}.#{name}(#{args}) (called class method missing)"
  end
end