Skip to content

Instantly share code, notes, and snippets.

View eccegordo's full-sized avatar

Gordon Potter eccegordo

View GitHub Profile
(function (global) {
"use strict";
function empty(obj) {
var key;
for (key in obj) if (obj.hasOwnProperty(key)) return false;
return true;
}
var Ember = global.Ember,
See it in action
http://jsbin.com/omIZeq/4
class JrClientGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
def self.process_resource(resource_klass)
attributes = resource_klass._attributes.clone
model_klass = resource_klass._model_name.safe_constantize
# We only want the type value from each column, and we also need
# to convert the key to a symbol, if you're using non AR records to back
# your JR model, its not going to have an attribute hash, so lets just