lib/parse/model/core/actions.rb
def first_or_create(query_attrs = {}, resource_attrs = {})
      conditions(query_attrs)
      klass = Parse::Model.find_class self.table
      if klass.blank?
        raise ArgumentError, "Parse model with class name #{self.table} is not registered."
      end
      hash_constraints = constraints(true)
      klass.first_or_create(hash_constraints, resource_attrs)
    end
def first_or_create(query_attrs = {}, resource_attrs = {})
      conditions(query_attrs)
      klass = Parse::Model.find_class self.table
      if klass.blank?
        raise ArgumentError, "Parse model with class name #{self.table} is not registered."
      end
      hash_constraints = constraints(true)
      klass.first_or_create(hash_constraints, resource_attrs)
    end
def first_or_create ( query_attrs = { } , resource_attrs = { } ) conditions ( query_attrs ) klass = Parse :: Model . find_class self . table if klass . blank? raise ArgumentError , "Parse model with class name #{self.table} is not registered." end hash_constraints = constraints ( true ) klass . first_or_create ( hash_constraints , resource_attrs ) end
Supporting the `first_or_create` class method to be used in scope chaining with queries.
 @!visibility private
Supporting the first_or_create class method to be used in scope chaining with queries .