This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See it in action | |
http://jsbin.com/omIZeq/4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |