def conditions_to_fields(conditions)
      conditions.inject({}) do |fields, (key, value)|
        fields.merge(key => value)
      end
    end
def conditions_to_fields(conditions)
      conditions.inject({}) do |fields, (key, value)|
        fields.merge(key => value)
      end
    end
Introspects the klass to convert and objects in conditions into foreign key and type fields