This works with Ember Data 1.0.0-beta.7+canary.b45e23ba, but not Ember Data 1.0.0-beta.8.2a68c63a.
normalizePayload
now takes just a payload.
What is the new way to do this?
require 'spec_helper' | |
describe 'Users' do | |
fixtures :all | |
let(:user) { admin_users(:amiel) } | |
before { login_to_admin } | |
describe '#index' do | |
it 'renders without fail' do | |
visit '/admin/users' |
This works with Ember Data 1.0.0-beta.7+canary.b45e23ba, but not Ember Data 1.0.0-beta.8.2a68c63a.
normalizePayload
now takes just a payload.
What is the new way to do this?
$ npm --version | |
1.3.21 | |
$ ember --version | |
version: 0.0.37 |
ApplicationSerializer = DS.RESTSerializer.extend | |
extract: (store, type, payload, id, requestType) -> | |
newPayload = {} | |
newPayload[type.typeKey] = payload | |
@_super store, type, newPayload, id, requestType | |
serializeIntoHash: (hash, type, record, options) -> | |
Ember.merge hash, @serialize record, options |
var controller = this; | |
var success = function(model) { | |
controller.transitionToRoute('...'); | |
}; | |
var failure = function(xhr) { | |
controller.get('model').rollback(); | |
if (xhr.status == 400) { | |
controller.showError($.parseJSON(xhr.responseText).detail); |
noun_type_enable_disable = new CmdUtils.NounType( "Enable / Disable", ['enable', 'disable'] ); | |
CmdUtils.CreateCommand({ | |
name: "javascript", | |
synonyms: ['js'], | |
description: 'Enable or disable javascript for your browser. You will have to refresh the page for changes to take effect.', | |
author: { | |
name: 'Amiel Martin', | |
email: 'amiel@tatango.com' |
CmdUtils.CreateCommand({ | |
name: "hello-world", | |
execute: function() { | |
var doc = Application.activeWindow.activeTab.document; | |
// find div.foo in the body of that document | |
jQuery('#content', doc.body).html('woot'); | |
displayMessage( "Hello, World!" ); |
def length_of_time_in_words(seconds) | |
seconds = seconds.to_i | |
%w[ year month week day hour minute second ].collect do |unit| | |
unit_in_seconds = 1.send(unit).to_i | |
n = seconds / unit_in_seconds | |
seconds -= n * unit_in_seconds | |
module IncrementifyString | |
# Helps create a user friendly unique string | |
# For example, calling incrementify! repeatedly starting with | |
# 'string' would yield: | |
# 'string' => 'string1' => 'string2' => 'string3' ... 'string9' => 'string10' => 'string11' ... etc | |
def incrementify! | |
if match(/[0-8]$/) | |
succ! # this is faster than regex parse and to_i + 1 to_s | |
elsif ends_with?('9') | |
m = match(/(\d+)$/) |