Method: UpdateOrCreate::ClassMethods#method_missing_with_update_or_create

Defined in:
lib/update_or_create.rb

#method_missing_with_update_or_create(method_id, *args, &block) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/update_or_create.rb', line 8

def method_missing_with_update_or_create(method_id, *args, &block)
  method_name = method_id.to_s
  if method_name =~ /^update_or_create_by_(.+)$/
    update_or_create($1, *args, &block)
  else
    method_missing_without_update_or_create(method_id, *args, &block)
  end
end