This file contains hidden or 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
| %{foo: foo, bar: bar} = some_map |
This file contains hidden or 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
| {foo, bar} = some_map |
This file contains hidden or 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
| defmodule BelongsToReferenceKeyTest do | |
| use ExUnit.Case | |
| defmodule Foo do | |
| use Ecto.Model | |
| @primary_key {:foobar_id, :id, []} | |
| schema "foos" do | |
| belongs_to :bar, Bar |
This file contains hidden or 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
| getModelTypes: function() { | |
| var namespaces = Ember.A(Ember.Namespace.NAMESPACES), types = Ember.A(), self = this; | |
| Object.keys(window.require._eak_seen).reduce(function(previous, item, index, enumerable) { | |
| var match; | |
| if ((match = item.match(/app\/models\/(\w+)/)) && match[1]) { | |
| previous.push(self.get('container').lookupFactory('model:' + match[1])); | |
| } |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
| /*! | |
| * @overview Ember - JavaScript Application Framework | |
| * @copyright Copyright 2011-2014 Tilde Inc. and contributors | |
| * Portions Copyright 2006-2011 Strobe Inc. | |
| * Portions Copyright 2008-2011 Apple Inc. All rights reserved. | |
| * @license Licensed under MIT license | |
| * See https://raw.github.com/emberjs/ember.js/master/LICENSE | |
| * @version 1.4.0 | |
| */ |
This file contains hidden or 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
| this.resource('posts'); | |
| // resolves to controllers/posts, templates/posts, routes/posts | |
| this.resource('users', function() { | |
| this.resource('posts'); | |
| // resolves to controllers/posts, templates/posts, routes/posts | |
| }); |
This file contains hidden or 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
| def method_a | |
| method_b do | |
| thing = 'hey' | |
| end | |
| end | |
| def method_b | |
| thing = nil | |
| yield |
This file contains hidden or 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
| // This doesn't work because the method is always unique | |
| Ember.run.debounce(this, function() { | |
| // blah blah blah | |
| }, 1000); | |
| // This would run a comparison against target & "unique-id" rather than target & method | |
| Ember.run.debounce(this, function() { | |
| // blah blah blah | |
| }, 1000, 'unique-id'); |
This file contains hidden or 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
| export default Ember.Handlebars.helpers('money', function(amount) { | |
| return "$" + amount; | |
| }); |
This file contains hidden or 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
| export default Ember.Handlebars.makeBoundHelper(function(amount) { | |
| return "$" + amount; | |
| }); |
OlderNewer