replace getPath/setPath with get/set now that ember supports it
This commit is contained in:
parent
0e10ad2e01
commit
0e52977417
|
@ -44,7 +44,7 @@ Ember.ENV.RAISE_ON_DEPRECATION = true
|
|||
view.appendTo(@get('rootElement') || 'body')
|
||||
|
||||
connectLayout: (name) ->
|
||||
unless @getPath('layout.name') == name
|
||||
unless @get('layout.name') == name
|
||||
name = $.camelize(name)
|
||||
viewClass = Travis["#{name}Layout"]
|
||||
@layout = Travis["#{name}Controller"].create(parent: @controller)
|
||||
|
|
|
@ -47,15 +47,15 @@ Travis.RepositoryController = Travis.Controller.extend
|
|||
@connectTab('job')
|
||||
|
||||
repositoriesByParams: (->
|
||||
Travis.Repository.bySlug("#{@getPath('params.owner')}/#{@getPath('params.name')}")
|
||||
Travis.Repository.bySlug("#{@get('params.owner')}/#{@get('params.name')}")
|
||||
).property('params.owner', 'params.name')
|
||||
|
||||
buildById: (->
|
||||
Travis.Build.find(id) if id = @getPath('params.id')
|
||||
Travis.Build.find(id) if id = @get('params.id')
|
||||
).property('params.id')
|
||||
|
||||
jobById: (->
|
||||
Travis.Job.find(id) if id = @getPath('params.id')
|
||||
Travis.Job.find(id) if id = @get('params.id')
|
||||
).property('params.id')
|
||||
|
||||
connectTab: (tab) ->
|
||||
|
@ -70,7 +70,7 @@ Travis.RepositoryController = Travis.Controller.extend
|
|||
|
||||
setParams: (params) ->
|
||||
# TODO if we just @set('params', params) it will update the repositoriesByParams property
|
||||
@setPath("params.#{key}", params[key]) for key, value of params
|
||||
@set("params.#{key}", params[key]) for key, value of params
|
||||
|
||||
_bind: (to, from) ->
|
||||
@bindings.push Ember.oneWay(this, to, from)
|
||||
|
|
|
@ -61,7 +61,7 @@ Travis.reopen
|
|||
@set('page', if @isLast() then 0 else @get('page') + 1)
|
||||
|
||||
pages: (->
|
||||
length = @getPath('content.length')
|
||||
length = @get('content.length')
|
||||
if length then parseInt(length / @get('perPage') + 1) else 1
|
||||
).property('length')
|
||||
|
||||
|
|
|
@ -19,11 +19,11 @@ require 'travis/model'
|
|||
jobs: DS.hasMany('Travis.Job', key: 'job_ids')
|
||||
|
||||
config: (->
|
||||
Travis.Helpers.compact(@getPath('data.config'))
|
||||
Travis.Helpers.compact(@get('data.config'))
|
||||
).property('data.config')
|
||||
|
||||
isMatrix: (->
|
||||
@getPath('data.job_ids.length') > 1
|
||||
@get('data.job_ids.length') > 1
|
||||
).property('data.job_ids.length')
|
||||
|
||||
requiredJobs: (->
|
||||
|
|
|
@ -21,11 +21,11 @@ require 'travis/model'
|
|||
log: DS.belongsTo('Travis.Artifact', key: 'log_id')
|
||||
|
||||
config: (->
|
||||
Travis.Helpers.compact(@getPath('data.config'))
|
||||
Travis.Helpers.compact(@get('data.config'))
|
||||
).property('data.config')
|
||||
|
||||
sponsor: (->
|
||||
@getPath('data.sponsor')
|
||||
@get('data.sponsor')
|
||||
).property('data.sponsor')
|
||||
|
||||
configValues: (->
|
||||
|
|
|
@ -36,7 +36,7 @@ require 'travis/model'
|
|||
).property('slug')
|
||||
|
||||
lastBuildDuration: (->
|
||||
duration = @getPath('data.last_build_duration')
|
||||
duration = @get('data.last_build_duration')
|
||||
duration = Travis.Helpers.durationFrom(@get('lastBuildStartedAt'), @get('lastBuildFinishedAt')) unless duration
|
||||
duration
|
||||
).property('data.last_build_duration', 'lastBuildStartedAt', 'lastBuildFinishedAt')
|
||||
|
|
|
@ -6,7 +6,7 @@ require 'travis/model'
|
|||
link: DS.attr('string')
|
||||
|
||||
image: (->
|
||||
"images/sponsors/#{@getPath('data.image')}"
|
||||
"images/sponsors/#{@get('data.image')}"
|
||||
).property('data.image')
|
||||
|
||||
Travis.Sponsor.reopenClass
|
||||
|
|
|
@ -7,7 +7,7 @@ require 'travis/model'
|
|||
lastSeenAt: DS.attr('string')
|
||||
|
||||
payload: (->
|
||||
@getPath('data.payload')
|
||||
@get('data.payload')
|
||||
).property('data.payload')
|
||||
|
||||
number: (->
|
||||
|
@ -30,9 +30,9 @@ require 'travis/model'
|
|||
).property('repository', 'job_id', 'state')
|
||||
|
||||
repository: (->
|
||||
@getPath('payload.repository.slug')
|
||||
@get('payload.repository.slug')
|
||||
).property('payload.repository.slug')
|
||||
|
||||
job_id: (->
|
||||
@getPath('payload.job.id')
|
||||
@get('payload.job.id')
|
||||
).property('payload.job.id')
|
||||
|
|
|
@ -30,8 +30,8 @@ Travis.Store = DS.Store.extend
|
|||
# _updateAssociations: (type, name, data) ->
|
||||
# Em.get(type, 'associationsByName').forEach (key, meta) =>
|
||||
# if meta.kind == 'belongsTo' && id = data["#{key}_id"]
|
||||
# parent = type.find(data.id).getPath("#{key}.data")
|
||||
# ids = parent.getPath("data.#{name}_ids")
|
||||
# parent = type.find(data.id).get("#{key}.data")
|
||||
# ids = parent.get("data.#{name}_ids")
|
||||
# parent.set("data.#{name}_ids", ids.concat(data.id)) # if ids && !(data.id in ids)
|
||||
|
||||
# _updateAssociations: (type, name, data) ->
|
||||
|
|
|
@ -9,15 +9,15 @@
|
|||
commitBinding: 'build.commit'
|
||||
|
||||
color: (->
|
||||
Travis.Helpers.colorForResult(@getPath('build.result'))
|
||||
Travis.Helpers.colorForResult(@get('build.result'))
|
||||
).property('build.result')
|
||||
|
||||
urlBuild: (->
|
||||
Travis.Urls.build(@getPath('repository.slug'), @getPath('build.id'))
|
||||
Travis.Urls.build(@get('repository.slug'), @get('build.id'))
|
||||
).property('repository.slug', 'build.id')
|
||||
|
||||
urlGithubCommit: (->
|
||||
Travis.Urls.githubCommit(@getPath('repository.slug'), @getPath('commit.sha'))
|
||||
Travis.Urls.githubCommit(@get('repository.slug'), @get('commit.sha'))
|
||||
).property('repository.slug', 'commit.sha')
|
||||
|
||||
BuildView: Em.View.extend
|
||||
|
@ -28,22 +28,22 @@
|
|||
commitBinding: 'build.commit'
|
||||
|
||||
color: (->
|
||||
Travis.Helpers.colorForResult(@getPath('build.result'))
|
||||
Travis.Helpers.colorForResult(@get('build.result'))
|
||||
).property('build.result')
|
||||
|
||||
urlBuild: (->
|
||||
Travis.Urls.build(@getPath('repository.slug'), @getPath('build.id'))
|
||||
Travis.Urls.build(@get('repository.slug'), @get('build.id'))
|
||||
).property('repository.slug', 'build.id')
|
||||
|
||||
urlGithubCommit: (->
|
||||
Travis.Urls.githubCommit(@getPath('repository.slug'), @getPath('commit.sha'))
|
||||
Travis.Urls.githubCommit(@get('repository.slug'), @get('commit.sha'))
|
||||
).property('repository.slug', 'commit.sha')
|
||||
|
||||
urlAuthor: (->
|
||||
Travis.Urls.email(@getPath('commit.authorEmail'))
|
||||
Travis.Urls.email(@get('commit.authorEmail'))
|
||||
).property('commit.authorEmail')
|
||||
|
||||
urlCommitter: (->
|
||||
Travis.Urls.email(@getPath('commit.committerEmail'))
|
||||
Travis.Urls.email(@get('commit.committerEmail'))
|
||||
).property('commit.committerEmail')
|
||||
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
jobBinding: 'context'
|
||||
|
||||
color: (->
|
||||
Travis.Helpers.colorForResult(@getPath('job.result'))
|
||||
Travis.Helpers.colorForResult(@get('job.result'))
|
||||
).property('job.result')
|
||||
|
||||
urlJob: (->
|
||||
Travis.Urls.job(@getPath('repository.slug'), @getPath('job.id'))
|
||||
Travis.Urls.job(@get('repository.slug'), @get('job.id'))
|
||||
).property('repository.slug', 'job.id')
|
||||
|
||||
JobView: Em.View.extend
|
||||
|
@ -26,23 +26,23 @@
|
|||
commitBinding: 'job.commit'
|
||||
|
||||
color: (->
|
||||
Travis.Helpers.colorForResult(@getPath('job.result'))
|
||||
Travis.Helpers.colorForResult(@get('job.result'))
|
||||
).property('job.result')
|
||||
|
||||
urlJob: (->
|
||||
Travis.Urls.job(@getPath('repository.slug'), @getPath('job.id'))
|
||||
Travis.Urls.job(@get('repository.slug'), @get('job.id'))
|
||||
).property('repository.slug', 'job.id')
|
||||
|
||||
urlGithubCommit: (->
|
||||
Travis.Urls.githubCommit(@getPath('repository.slug'), @getPath('commit.sha'))
|
||||
Travis.Urls.githubCommit(@get('repository.slug'), @get('commit.sha'))
|
||||
).property('repository.slug', 'commit.sha')
|
||||
|
||||
urlAuthor: (->
|
||||
Travis.Urls.email(@getPath('commit.authorEmail'))
|
||||
Travis.Urls.email(@get('commit.authorEmail'))
|
||||
).property('commit.authorEmail')
|
||||
|
||||
urlCommitter: (->
|
||||
Travis.Urls.email(@getPath('commit.committerEmail'))
|
||||
Travis.Urls.email(@get('commit.committerEmail'))
|
||||
).property('commit.committerEmail')
|
||||
|
||||
LogView: Em.View.extend
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
userBinding: 'controller.user'
|
||||
|
||||
gravatarUrl: (->
|
||||
"http://www.gravatar.com/avatar/#{@getPath('user.gravatar')}?s=48&d=mm"
|
||||
"http://www.gravatar.com/avatar/#{@get('user.gravatar')}?s=48&d=mm"
|
||||
).property('user.gravatar')
|
||||
|
||||
HooksView: Em.View.extend
|
||||
templateName: 'profile/hooks'
|
||||
|
||||
urlGithubAdmin: (->
|
||||
Travis.Urls.githubAdmin(@getPath('hook.slug'))
|
||||
Travis.Urls.githubAdmin(@get('hook.slug'))
|
||||
).property('hook.slug')
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
classOwned: (->
|
||||
classes = []
|
||||
classes.push('active') if @get('tab') == 'owned'
|
||||
classes.push('display') if Em.getPath('Travis.currentUser')
|
||||
classes.push('display') if Em.get('Travis.currentUser')
|
||||
classes.join(' ')
|
||||
).property('tab', 'Travis.currentUser')
|
||||
|
||||
|
@ -26,19 +26,19 @@
|
|||
).property('color', 'selected')
|
||||
|
||||
color: (->
|
||||
Travis.Helpers.colorForResult(@getPath('repository.lastBuildResult'))
|
||||
Travis.Helpers.colorForResult(@get('repository.lastBuildResult'))
|
||||
).property('repository.lastBuildResult')
|
||||
|
||||
selected: (->
|
||||
'selected' if @getPath('repository.selected')
|
||||
'selected' if @get('repository.selected')
|
||||
).property('repository.selected')
|
||||
|
||||
urlRepository: (->
|
||||
Travis.Urls.repository(@getPath('repository.slug'))
|
||||
Travis.Urls.repository(@get('repository.slug'))
|
||||
).property('repository.slug')
|
||||
|
||||
urlLastBuild: (->
|
||||
Travis.Urls.build(@getPath('repository.slug'), @getPath('repository.lastBuildId'))
|
||||
Travis.Urls.build(@get('repository.slug'), @get('repository.lastBuildId'))
|
||||
).property('repository.slug', 'repository.lastBuildId')
|
||||
|
||||
RepositoryView: Em.View.extend
|
||||
|
@ -47,17 +47,17 @@
|
|||
repositoryBinding: 'controller.repository'
|
||||
|
||||
class: (->
|
||||
'loading' unless @getPath('repository.isLoaded')
|
||||
'loading' unless @get('repository.isLoaded')
|
||||
).property('repository.isLoaded')
|
||||
|
||||
urlGithub: (->
|
||||
Travis.Urls.githubRepository(@getPath('repository.slug'))
|
||||
Travis.Urls.githubRepository(@get('repository.slug'))
|
||||
).property('repository.slug'),
|
||||
|
||||
urlGithubWatchers: (->
|
||||
Travis.Urls.githubWatchers(@getPath('repository.slug'))
|
||||
Travis.Urls.githubWatchers(@get('repository.slug'))
|
||||
).property('repository.slug'),
|
||||
|
||||
urlGithubNetwork: (->
|
||||
Travis.Urls.githubNetwork(@getPath('repository.slug'))
|
||||
Travis.Urls.githubNetwork(@get('repository.slug'))
|
||||
).property('repository.slug'),
|
||||
|
|
|
@ -40,31 +40,31 @@
|
|||
).property('tab')
|
||||
|
||||
urlRepository: (->
|
||||
Travis.Urls.repository(@getPath('repository.slug'))
|
||||
Travis.Urls.repository(@get('repository.slug'))
|
||||
).property('repository.slug')
|
||||
|
||||
urlBuilds: (->
|
||||
Travis.Urls.builds(@getPath('repository.slug'))
|
||||
Travis.Urls.builds(@get('repository.slug'))
|
||||
).property('repository.slug')
|
||||
|
||||
urlPullRequests: (->
|
||||
Travis.Urls.pullRequests(@getPath('repository.slug'))
|
||||
Travis.Urls.pullRequests(@get('repository.slug'))
|
||||
).property('repository.slug')
|
||||
|
||||
urlBranches: (->
|
||||
Travis.Urls.branches(@getPath('repository.slug'))
|
||||
Travis.Urls.branches(@get('repository.slug'))
|
||||
).property('repository.slug')
|
||||
|
||||
urlBuild: (->
|
||||
Travis.Urls.build(@getPath('repository.slug'), @getPath('build.id'))
|
||||
Travis.Urls.build(@get('repository.slug'), @get('build.id'))
|
||||
).property('repository.slug', 'build.id')
|
||||
|
||||
urlJob: (->
|
||||
Travis.Urls.job(@getPath('repository.slug'), @getPath('job.id'))
|
||||
Travis.Urls.job(@get('repository.slug'), @get('job.id'))
|
||||
).property('repository.slug', 'job.id')
|
||||
|
||||
urlStatusImage: (->
|
||||
Travis.Urls.statusImage(@getPath('repository.slug'), @getPath('branch.commit.branch'))
|
||||
Travis.Urls.statusImage(@get('repository.slug'), @get('branch.commit.branch'))
|
||||
).property('repository.slug', 'branch')
|
||||
|
||||
markdownStatusImage: (->
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# ).property('Travis.app.currentUser')
|
||||
|
||||
gravatarUrl: (->
|
||||
"http://www.gravatar.com/avatar/#{@getPath('user.gravatar')}?s=24&d=mm"
|
||||
"http://www.gravatar.com/avatar/#{@get('user.gravatar')}?s=24&d=mm"
|
||||
).property('user.gravatar')
|
||||
|
||||
# hrm. how to parametrize bindAttr?
|
||||
|
@ -19,11 +19,11 @@
|
|||
).property('tab')
|
||||
|
||||
classStats: (->
|
||||
'active' if @getPath('tab') == 'stats'
|
||||
'active' if @get('tab') == 'stats'
|
||||
).property('tab')
|
||||
|
||||
classProfile: (->
|
||||
if @getPath('tab') == 'profile' then 'profile active' else 'profile'
|
||||
if @get('tab') == 'profile' then 'profile active' else 'profile'
|
||||
).property('tab')
|
||||
|
||||
showProfile: ->
|
||||
|
|
|
@ -11,7 +11,7 @@ var BoundHelperView = Ember.View.extend(Ember._Metamorph, {
|
|||
value: Ember.K,
|
||||
|
||||
valueForRender: function() {
|
||||
var value = this.value(Ember.getPath(this.context, this.property), this.options);
|
||||
var value = this.value(Ember.get(this.context, this.property), this.options);
|
||||
if (this.options.escaped) { value = Handlebars.Utils.escapeExpression(value); }
|
||||
return value;
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
window.onTrue = (object, path, callback) ->
|
||||
if object.getPath(path)
|
||||
if object.get(path)
|
||||
callback()
|
||||
else
|
||||
observer = ->
|
||||
|
|
51
assets/javascripts/vendor/ember-data.js
vendored
51
assets/javascripts/vendor/ember-data.js
vendored
|
@ -102,7 +102,7 @@ DS.AdapterPopulatedRecordArray = DS.RecordArray.extend({
|
|||
|
||||
|
||||
(function() {
|
||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath, guidFor = Ember.guidFor;
|
||||
var get = Ember.get, set = Ember.set, guidFor = Ember.guidFor;
|
||||
|
||||
var Set = function() {
|
||||
this.hash = {};
|
||||
|
@ -229,7 +229,7 @@ DS.ManyArrayStateManager = Ember.StateManager.extend({
|
|||
init: function() {
|
||||
this._super();
|
||||
this.dirty = new Set();
|
||||
this.counter = getPath(this, 'manyArray.length');
|
||||
this.counter = get(this, 'manyArray.length');
|
||||
},
|
||||
|
||||
decrement: function(count) {
|
||||
|
@ -248,7 +248,7 @@ DS.ManyArrayStateManager = Ember.StateManager.extend({
|
|||
|
||||
|
||||
(function() {
|
||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath, setPath = Ember.setPath;
|
||||
var get = Ember.get, set = Ember.set, set = Ember.set;
|
||||
|
||||
DS.ManyArray = DS.RecordArray.extend({
|
||||
init: function() {
|
||||
|
@ -260,11 +260,11 @@ DS.ManyArray = DS.RecordArray.extend({
|
|||
parentRecord: null,
|
||||
|
||||
isDirty: Ember.computed(function() {
|
||||
return getPath(this, 'stateManager.currentState.isDirty');
|
||||
return get(this, 'stateManager.currentState.isDirty');
|
||||
}).property('stateManager.currentState').cacheable(),
|
||||
|
||||
isLoaded: Ember.computed(function() {
|
||||
return getPath(this, 'stateManager.currentState.isLoaded');
|
||||
return get(this, 'stateManager.currentState.isLoaded');
|
||||
}).property('stateManager.currentState').cacheable(),
|
||||
|
||||
send: function(event, context) {
|
||||
|
@ -381,7 +381,7 @@ DS.ManyArray = DS.RecordArray.extend({
|
|||
|
||||
|
||||
(function() {
|
||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath, fmt = Ember.String.fmt,
|
||||
var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt,
|
||||
removeObject = Ember.EnumerableUtils.removeObject;
|
||||
|
||||
/**
|
||||
|
@ -513,7 +513,7 @@ DS.Transaction = Ember.Object.extend({
|
|||
Ember.assert("Once a record has changed, you cannot move it into a different transaction", !get(record, 'isDirty'));
|
||||
|
||||
var recordTransaction = get(record, 'transaction'),
|
||||
defaultTransaction = getPath(this, 'store.defaultTransaction');
|
||||
defaultTransaction = get(this, 'store.defaultTransaction');
|
||||
|
||||
Ember.assert("Models cannot belong to more than one transaction at a time.", recordTransaction === defaultTransaction);
|
||||
|
||||
|
@ -625,7 +625,7 @@ DS.Transaction = Ember.Object.extend({
|
|||
@param {DS.Model} record
|
||||
*/
|
||||
remove: function(record) {
|
||||
var defaultTransaction = getPath(this, 'store.defaultTransaction');
|
||||
var defaultTransaction = get(this, 'store.defaultTransaction');
|
||||
defaultTransaction.adoptRecord(record);
|
||||
},
|
||||
|
||||
|
@ -879,7 +879,7 @@ DS.Transaction = Ember.Object.extend({
|
|||
|
||||
(function() {
|
||||
/*globals Ember*/
|
||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath, fmt = Ember.String.fmt;
|
||||
var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
|
||||
|
||||
var DATA_PROXY = {
|
||||
get: function(name) {
|
||||
|
@ -1012,7 +1012,7 @@ DS.Store = Ember.Object.extend({
|
|||
_adapter: Ember.computed(function() {
|
||||
var adapter = get(this, 'adapter');
|
||||
if (typeof adapter === 'string') {
|
||||
return getPath(this, adapter, false) || getPath(window, adapter);
|
||||
return get(this, adapter, false) || get(window, adapter);
|
||||
}
|
||||
return adapter;
|
||||
}).property('adapter').cacheable(),
|
||||
|
@ -1834,7 +1834,7 @@ DS.Store = Ember.Object.extend({
|
|||
|
||||
|
||||
(function() {
|
||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath, guidFor = Ember.guidFor;
|
||||
var get = Ember.get, set = Ember.set, guidFor = Ember.guidFor;
|
||||
|
||||
/**
|
||||
This file encapsulates the various states that a record can transition
|
||||
|
@ -1863,7 +1863,7 @@ var get = Ember.get, set = Ember.set, getPath = Ember.getPath, guidFor = Ember.g
|
|||
string. You can determine a record's current state by getting its manager's
|
||||
current state path:
|
||||
|
||||
record.getPath('stateManager.currentState.path');
|
||||
record.get('stateManager.currentState.path');
|
||||
//=> "created.uncommitted"
|
||||
|
||||
The `DS.Model` states are themselves stateless. What we mean is that,
|
||||
|
@ -1949,7 +1949,7 @@ var get = Ember.get, set = Ember.set, getPath = Ember.getPath, guidFor = Ember.g
|
|||
state in a more user-friendly way than examining its state path. For example,
|
||||
instead of doing this:
|
||||
|
||||
var statePath = record.getPath('stateManager.currentState.path');
|
||||
var statePath = record.get('stateManager.currentState.path');
|
||||
if (statePath === 'created.inFlight') {
|
||||
doSomething();
|
||||
}
|
||||
|
@ -2836,10 +2836,10 @@ DataProxy.prototype = {
|
|||
|
||||
|
||||
(function() {
|
||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath, none = Ember.none;
|
||||
var get = Ember.get, set = Ember.set, none = Ember.none;
|
||||
|
||||
var retrieveFromCurrentState = Ember.computed(function(key) {
|
||||
return get(getPath(this, 'stateManager.currentState'), key);
|
||||
return get(get(this, 'stateManager.currentState'), key);
|
||||
}).property('stateManager.currentState').cacheable();
|
||||
|
||||
DS.Model = Ember.Object.extend(Ember.Evented, {
|
||||
|
@ -3194,7 +3194,7 @@ DS.Model.reopenClass({
|
|||
|
||||
|
||||
(function() {
|
||||
var get = Ember.get, getPath = Ember.getPath;
|
||||
var get = Ember.get;
|
||||
DS.Model.reopenClass({
|
||||
attributes: Ember.computed(function() {
|
||||
var map = Ember.Map.create();
|
||||
|
@ -3365,7 +3365,7 @@ DS.attr.transforms = {
|
|||
|
||||
|
||||
(function() {
|
||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath,
|
||||
var get = Ember.get, set = Ember.set,
|
||||
none = Ember.none;
|
||||
|
||||
var embeddedFindRecord = function(store, type, data, key, one) {
|
||||
|
@ -3390,7 +3390,7 @@ var hasAssociation = function(type, options, one) {
|
|||
store = get(this, 'store');
|
||||
|
||||
if (typeof type === 'string') {
|
||||
type = getPath(this, type, false) || getPath(window, type);
|
||||
type = get(this, type, false) || get(window, type);
|
||||
}
|
||||
|
||||
if (arguments.length === 2) {
|
||||
|
@ -3428,7 +3428,7 @@ DS.belongsTo = function(type, options) {
|
|||
|
||||
|
||||
(function() {
|
||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath;
|
||||
var get = Ember.get, set = Ember.set;
|
||||
var embeddedFindRecord = function(store, type, data, key) {
|
||||
var association = get(data, key);
|
||||
return association ? store.loadMany(type, association).ids : [];
|
||||
|
@ -3452,7 +3452,7 @@ var hasAssociation = function(type, options) {
|
|||
ids, id, association;
|
||||
|
||||
if (typeof type === 'string') {
|
||||
type = getPath(this, type, false) || getPath(window, type);
|
||||
type = get(this, type, false) || get(window, type);
|
||||
}
|
||||
|
||||
key = options.key || get(this, 'namingConvention').keyToJSONKey(key);
|
||||
|
@ -3474,7 +3474,7 @@ DS.hasMany = function(type, options) {
|
|||
|
||||
|
||||
(function() {
|
||||
var get = Ember.get, getPath = Ember.getPath;
|
||||
var get = Ember.get;
|
||||
|
||||
DS.Model.reopenClass({
|
||||
typeForAssociation: function(name) {
|
||||
|
@ -3491,7 +3491,7 @@ DS.Model.reopenClass({
|
|||
typeList = map.get(type);
|
||||
|
||||
if (typeof type === 'string') {
|
||||
type = getPath(this, type, false) || getPath(window, type);
|
||||
type = get(this, type, false) || get(window, type);
|
||||
meta.type = type;
|
||||
}
|
||||
|
||||
|
@ -3516,7 +3516,7 @@ DS.Model.reopenClass({
|
|||
type = meta.type;
|
||||
|
||||
if (typeof type === 'string') {
|
||||
type = getPath(this, type, false) || getPath(window, type);
|
||||
type = get(this, type, false) || get(window, type);
|
||||
meta.type = type;
|
||||
}
|
||||
|
||||
|
@ -3837,7 +3837,7 @@ DS.fixtureAdapter = DS.FixtureAdapter.create();
|
|||
(function() {
|
||||
/*global jQuery*/
|
||||
|
||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath;
|
||||
var get = Ember.get, set = Ember.set;
|
||||
|
||||
DS.RESTAdapter = DS.Adapter.extend({
|
||||
bulkCommit: false,
|
||||
|
@ -4007,7 +4007,6 @@ DS.RESTAdapter = DS.Adapter.extend({
|
|||
data: { ids: ids },
|
||||
success: function(json) {
|
||||
this.sideload(store, type, json, plural);
|
||||
console.log(type, json, plural)
|
||||
store.loadMany(type, json[plural]);
|
||||
}
|
||||
});
|
||||
|
@ -4087,7 +4086,7 @@ DS.RESTAdapter = DS.Adapter.extend({
|
|||
sideloadedType = get(mappings, prop);
|
||||
|
||||
if (typeof sideloadedType === 'string') {
|
||||
sideloadedType = getPath(window, sideloadedType);
|
||||
sideloadedType = get(window, sideloadedType);
|
||||
}
|
||||
|
||||
Ember.assert("Your server returned a hash with the key " + prop + " but you have no mapping for it", !!sideloadedType);
|
||||
|
|
1212
assets/javascripts/vendor/ember.js
vendored
1212
assets/javascripts/vendor/ember.js
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user