<commit_before>
/*
 * namespace for the DSP Adapter
 */
var EmberDreamFactoryAdapter = {};

/*
 * Serializer overrides
 */
EmberDreamFactoryAdapter.Serializer = DS.RESTSerializer.extend({

	extractArray: function(store, primaryType, payload) {
		var namespacedPayload = {};
		namespacedPayload[Ember.String.pluralize(primaryType.typeKey)] = payload.record;
		return this._super(store, primaryType, namespacedPayload);
	},

	extractSingle: function (store, primaryType, payload, recordId) {
		var namespacedPayload = {};
		namespacedPayload[primaryType.typeKey] = payload;
		return this._super(store, primaryType, namespacedPayload, recordId);
	},

	typeForRoot: function (key) {
		return Ember.String.dasherize(Ember.String.singularize(key));
	},

	serialize: function (record, options) {
		options = options || { includeId: true };
		return this._super(record, options);
	},

	// set the JSON root to 'record' to make DSP happy
	serializeIntoHash: function (data, type, record, options) {
		var root = 'record';
		data[root] = this.serialize(record, options);
	}
});

/*
 * An Ember Data Adapter written to use DreamFactory REST API
 * @type {DS.RESTAdapter}
 */
EmberDreamFactoryAdapter.Adapter = DS.RESTAdapter.extend({
	
	defaultSerializer: '-dreamfactory',

	init: function () {
		this._super();<commit_msg>Fix bug with extractSingle<commit_after>
/*
 * namespace for the DSP Adapter
 */
var EmberDreamFactoryAdapter = {};

/*
 * Serializer overrides
 */
EmberDreamFactoryAdapter.Serializer = DS.RESTSerializer.extend({

	extractArray: function(store, primaryType, payload) {
		var namespacedPayload = {};
		namespacedPayload[Ember.String.pluralize(primaryType.typeKey)] = payload.record;
		return this._super(store, primaryType, namespacedPayload);
	},

	extractSingle: function (store, primaryType, payload, recordId) {
		var namespacedPayload = {};
		namespacedPayload[primaryType.typeKey] = payload.record[0]; // abstract at some point
		return this._super(store, primaryType, namespacedPayload, recordId);
	},

	typeForRoot: function (key) {
		return Ember.String.dasherize(Ember.String.singularize(key));
	},

	serialize: function (record, options) {
		options = options || { includeId: true };
		return this._super(record, options);
	},

	// set the JSON root to 'record' to make DSP happy
	serializeIntoHash: function (data, type, record, options) {
		var root = 'record';
		data[root] = this.serialize(record, options);
	}
});

/*
 * An Ember Data Adapter written to use DreamFactory REST API
 * @type {DS.RESTAdapter}
 */
EmberDreamFactoryAdapter.Adapter = DS.RESTAdapter.extend({
	
	defaultSerializer: '-dreamfactory',

	init: function () {
		this._super();
{'fraction_non_alphanumeric': 0.12607557052001497, 'fraction_numerical': 0.0003741114852225963, 'mean_word_length': 4.942222222222222, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7135113', 'n_tokens_mistral': 864, 'n_tokens_neox': 801, 'n_words': 198}