def assert_valid_fields(fields, unique)
      valid_properties = model.properties

      model.descendants.each do |descendant|
        valid_properties += descendant.properties
      end

      fields.each do |field|
        case field
          when Symbol, String
            unless valid_properties.named?(field)
              raise ArgumentError, "+options[:fields]+ entry #{field.inspect} does not map to a property in #{model}"
            end
        end
      end
    end
def assert_valid_fields(fields, unique)
      valid_properties = model.properties

      model.descendants.each do |descendant|
        valid_properties += descendant.properties
      end

      fields.each do |field|
        case field
          when Symbol, String
            unless valid_properties.named?(field)
              raise ArgumentError, "+options[:fields]+ entry #{field.inspect} does not map to a property in #{model}"
            end
        end
      end
    end
Verifies that value of :fields option
 refers to existing properties

 @api private