Sha256: c4fc0b3a3d2454ffce448b02ae70aefba11117404c1e83877bbd1a06f2d461a6
Contents?: true
Size: 1.97 KB
Versions: 1
Compression:
Stored size: 1.97 KB
Contents
<% # TODO mover para helper base_path = Rails.root.join('app', 'assets', 'javascripts', 'models') models_list = Dir.glob(Rails.root.join(base_path, '**', '*.js*')) models_list.map! do |file| file.sub! base_path.to_s + '/', '' # Ignore Emacs temporary files next nil if file =~ /~/ entries = file.split /\// || [] entries.unshift 'models' entries.push File.basename entries.pop, '.js.coffee' File.join *entries end.compact! models_list.each do |model_file| require_asset model_file end %> 'use strict' root = exports ? this define 'aura/extensions/models', <%= models_list.to_json %>, (models...) -> # TODO better require api for indemma indemma = require 'indemma' require 'indefinido-indemma/lib/extensions/rivets' require 'indefinido-indemma/lib/record/rest' require 'indefinido-indemma/lib/record/associable' require 'indefinido-indemma/lib/record/scopable' require 'indefinido-indemma/lib/record/restfulable' require 'indefinido-indemma/lib/record/resource' require 'indefinido-indemma/lib/record/maid' require 'indefinido-indemma/lib/record/validatable' # Extension definition initialize: (application) -> core = application.core sandbox = application.sandbox core.util.inflector = cssify: (sentence) -> sentence.replace /\//, '-' pluralize: indemma.model.pluralize singularize: indemma.model.singularize # TODO rename core.models to core.domain, completely core.domain = core.models = sandbox.models = indemma.model core.model = sandbox.model = (name) -> # TODO use a Map internally in indemma model = indemma.model[name] throw new Error "Model '#{name}' not found!" unless model? model # TODO rename core.models to core.domain, completely core.domain.record = core.models.record = sandbox.models.record = indemma.record # build all model definitions core.util._.map models, (model) -> indemma.model.call model
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ende-0.1.14 | lib/assets/javascripts/aura/extensions/models.js.coffee.erb |