rasputin 0.11.1 → 0.11.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +12 -3
- data/lib/rasputin/version.rb +1 -1
- data/vendor/assets/javascripts/ember-datastore.js +148 -310
- data/vendor/assets/javascripts/ember-datetime.js +22 -21
- data/vendor/assets/javascripts/ember.js +219 -52
- metadata +10 -10
data/README.md
CHANGED
@@ -6,6 +6,7 @@ This is a gem for integration of Ember.js with Rails 3.1 assets pipeline.
|
|
6
6
|
It provide direct requires for official ember packages :
|
7
7
|
|
8
8
|
* ember
|
9
|
+
* ember-datetime
|
9
10
|
* ember-datastore
|
10
11
|
* ember-touch
|
11
12
|
* ember-routing
|
@@ -24,7 +25,7 @@ Examples :
|
|
24
25
|
todos/templates/collection.hbs >> Ember.TEMPLATES['todos/collection']
|
25
26
|
|
26
27
|
If you want to keep using old naming scheme, put this in your rails configuration block :
|
27
|
-
|
28
|
+
|
28
29
|
config.rasputin.template_name_separator = '_'
|
29
30
|
|
30
31
|
The new default is '/'
|
@@ -42,7 +43,7 @@ If you use Slim templates, you can use handlebars filter :
|
|
42
43
|
{{view Ember.Button}}OK{{/view}}
|
43
44
|
|
44
45
|
It will be translated as :
|
45
|
-
|
46
|
+
|
46
47
|
<script type="text/x-handlebars">
|
47
48
|
{{view Ember.Button}}OK{{/view}}
|
48
49
|
</script>
|
@@ -58,7 +59,7 @@ In your javascript asset manifest (app/assets/javascripts/application.js) add th
|
|
58
59
|
|
59
60
|
//= require jquery
|
60
61
|
//= require ember
|
61
|
-
|
62
|
+
|
62
63
|
And any of the following you want to include:
|
63
64
|
|
64
65
|
//= require ember-datetime
|
@@ -76,6 +77,14 @@ In your stylesheet asset manifest (app/assets/stylesheets/application.css) add t
|
|
76
77
|
ChangeLog
|
77
78
|
----------
|
78
79
|
|
80
|
+
0.11.3
|
81
|
+
|
82
|
+
* update Ember.js to 0.9.3 and clean up ember-datastore
|
83
|
+
|
84
|
+
0.11.2
|
85
|
+
|
86
|
+
* update Ember.js to latest master
|
87
|
+
|
79
88
|
0.11.0
|
80
89
|
|
81
90
|
* renaming to Ember.js
|
data/lib/rasputin/version.rb
CHANGED
@@ -1,12 +1,10 @@
|
|
1
1
|
|
2
2
|
(function(exports) {
|
3
3
|
// ==========================================================================
|
4
|
-
// Project:
|
4
|
+
// Project: Ember IndexSet
|
5
5
|
// Copyright: ©2011 Strobe Inc. and contributors.
|
6
6
|
// License: Licensed under MIT license (see license.js)
|
7
7
|
// ==========================================================================
|
8
|
-
/*globals sc_assert */
|
9
|
-
|
10
8
|
var get = Ember.get, set = Ember.set, abs = Math.abs;
|
11
9
|
|
12
10
|
function isIndexSet(obj) {
|
@@ -99,7 +97,6 @@ function _sliceContent(c) {
|
|
99
97
|
@extends Ember.MutableEnumerable
|
100
98
|
@extends Ember.Copyable
|
101
99
|
@extends Ember.Freezable
|
102
|
-
@since SproutCore 1.0
|
103
100
|
*/
|
104
101
|
Ember.IndexSet = Ember.Object.extend(Ember.Enumerable, Ember.MutableEnumerable, Ember.Freezable, Ember.Copyable,
|
105
102
|
/** @scope Ember.IndexSet.prototype */ {
|
@@ -1055,7 +1052,7 @@ Ember.IndexSet = Ember.Object.extend(Ember.Enumerable, Ember.MutableEnumerable,
|
|
1055
1052
|
*/
|
1056
1053
|
addObject: function(object, firstOnly) {
|
1057
1054
|
var source = get(this, 'source');
|
1058
|
-
|
1055
|
+
ember_assert("%@.addObject() requires source".fmt(this), !!source);
|
1059
1056
|
|
1060
1057
|
var len = get(source, 'length'),
|
1061
1058
|
cur = 0, idx;
|
@@ -1102,7 +1099,7 @@ Ember.IndexSet = Ember.Object.extend(Ember.Enumerable, Ember.MutableEnumerable,
|
|
1102
1099
|
*/
|
1103
1100
|
removeObject: function(object, firstOnly) {
|
1104
1101
|
var source = get(this, 'source');
|
1105
|
-
|
1102
|
+
ember_assert("%@.removeObject() requires source".fmt(this), !!source);
|
1106
1103
|
|
1107
1104
|
var len = source.get('length'),
|
1108
1105
|
cur = 0, idx;
|
@@ -1240,18 +1237,15 @@ Ember.IndexSet.reopenClass({
|
|
1240
1237
|
|
1241
1238
|
|
1242
1239
|
(function(exports) {
|
1243
|
-
|
1244
1240
|
})({});
|
1245
1241
|
|
1246
1242
|
(function(exports) {
|
1247
1243
|
// ==========================================================================
|
1248
|
-
// Project:
|
1244
|
+
// Project: Ember DataStore - JavaScript Application Framework
|
1249
1245
|
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
1250
1246
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
1251
1247
|
// License: Licensed under MIT license (see license.js)
|
1252
1248
|
// ==========================================================================
|
1253
|
-
|
1254
|
-
|
1255
1249
|
var get = Ember.get, set = Ember.set, getPath = Ember.getPath;
|
1256
1250
|
|
1257
1251
|
/**
|
@@ -1292,15 +1286,15 @@ var get = Ember.get, set = Ember.set, getPath = Ember.getPath;
|
|
1292
1286
|
q = Ember.Query.create({
|
1293
1287
|
conditions: "firstName = 'Jonny' AND lastName = 'Cash'",
|
1294
1288
|
recordType: MyApp.MyModel,
|
1295
|
-
orderBy: "lastName, year
|
1289
|
+
orderBy: "lastName, year DESC"
|
1296
1290
|
});
|
1297
1291
|
|
1298
1292
|
The default order direction is ascending. You can change it to descending
|
1299
|
-
by writing `'
|
1293
|
+
by writing `'DESC'` behind the property name like in the example above.
|
1300
1294
|
If no order is given, or records are equal in respect to a given order,
|
1301
1295
|
records will be ordered by guid.
|
1302
1296
|
|
1303
|
-
|
1297
|
+
Ember Query Language
|
1304
1298
|
=====
|
1305
1299
|
|
1306
1300
|
Features of the query language:
|
@@ -1385,7 +1379,7 @@ var get = Ember.get, set = Ember.set, getPath = Ember.getPath;
|
|
1385
1379
|
@extends Ember.Object
|
1386
1380
|
@extends Ember.Copyable
|
1387
1381
|
@extends Ember.Freezable
|
1388
|
-
@since
|
1382
|
+
@since Ember 1.0
|
1389
1383
|
*/
|
1390
1384
|
|
1391
1385
|
Ember.Query = Ember.Object.extend(Ember.Copyable, Ember.Freezable,
|
@@ -1412,7 +1406,7 @@ Ember.Query = Ember.Object.extend(Ember.Copyable, Ember.Freezable,
|
|
1412
1406
|
|
1413
1407
|
/**
|
1414
1408
|
Optional orderBy parameters. This can be a string of keys, optionally
|
1415
|
-
beginning with the strings `"
|
1409
|
+
beginning with the strings `"DESC "` or `"ASC "` to select descending or
|
1416
1410
|
ascending order.
|
1417
1411
|
|
1418
1412
|
Alternatively, you can specify a comparison function, in which case the
|
@@ -2158,8 +2152,7 @@ Ember.Query = Ember.Object.extend(Ember.Copyable, Ember.Freezable,
|
|
2158
2152
|
// reserved words
|
2159
2153
|
if ( !t.delimeted ) {
|
2160
2154
|
for ( var anotherToken in grammar ) {
|
2161
|
-
if ( grammar[anotherToken].reservedWord
|
2162
|
-
&& anotherToken == tokenValue ) {
|
2155
|
+
if ( grammar[anotherToken].reservedWord && anotherToken == tokenValue ) {
|
2163
2156
|
tokenType = anotherToken;
|
2164
2157
|
}
|
2165
2158
|
}
|
@@ -2340,8 +2333,7 @@ Ember.Query = Ember.Object.extend(Ember.Copyable, Ember.Freezable,
|
|
2340
2333
|
function tokenIsMissingChilds (position) {
|
2341
2334
|
var p = position;
|
2342
2335
|
if ( p < 0 ) return true;
|
2343
|
-
return (expectedType('left',p) && !l[p].leftSide)
|
2344
|
-
|| (expectedType('right',p) && !l[p].rightSide);
|
2336
|
+
return (expectedType('left',p) && !l[p].leftSide) || (expectedType('right',p) && !l[p].rightSide);
|
2345
2337
|
}
|
2346
2338
|
|
2347
2339
|
function typesAreMatching (parent, child) {
|
@@ -2451,7 +2443,7 @@ Ember.Query = Ember.Object.extend(Ember.Copyable, Ember.Freezable,
|
|
2451
2443
|
p = p.replace(/\s+/,',');
|
2452
2444
|
p = p.split(',');
|
2453
2445
|
o[i] = {propertyName: p[0]};
|
2454
|
-
if (p[1] && p[1] == '
|
2446
|
+
if (p[1] && p[1] == 'DESC') o[i].descending = true;
|
2455
2447
|
}
|
2456
2448
|
|
2457
2449
|
return o;
|
@@ -2765,13 +2757,11 @@ Ember.Query.registerQueryExtension = function(tokenName, token) {
|
|
2765
2757
|
|
2766
2758
|
(function(exports) {
|
2767
2759
|
// ==========================================================================
|
2768
|
-
// Project:
|
2760
|
+
// Project: Ember DataStore - JavaScript Application Framework
|
2769
2761
|
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
2770
2762
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
2771
2763
|
// License: Licensed under MIT license (see license.js)
|
2772
2764
|
// ==========================================================================
|
2773
|
-
// @global Ember
|
2774
|
-
|
2775
2765
|
var get = Ember.get, set = Ember.set;
|
2776
2766
|
|
2777
2767
|
/**
|
@@ -2779,7 +2769,7 @@ var get = Ember.get, set = Ember.set;
|
|
2779
2769
|
|
2780
2770
|
An error, used to represent an error state.
|
2781
2771
|
|
2782
|
-
Many API's within
|
2772
|
+
Many API's within Ember will return an instance of this object whenever
|
2783
2773
|
they have an error occur. An error includes an error code, description,
|
2784
2774
|
and optional human readable label that indicates the item that failed.
|
2785
2775
|
|
@@ -2800,7 +2790,7 @@ var get = Ember.get, set = Ember.set;
|
|
2800
2790
|
instead of the receiver.
|
2801
2791
|
|
2802
2792
|
@extends Ember.Object
|
2803
|
-
@since
|
2793
|
+
@since Ember 1.0
|
2804
2794
|
*/
|
2805
2795
|
Ember.StoreError = Ember.Object.extend(
|
2806
2796
|
/** @scope Ember.StoreError.prototype */ {
|
@@ -2857,7 +2847,7 @@ Ember.StoreError = Ember.Object.extend(
|
|
2857
2847
|
@type Boolean
|
2858
2848
|
*/
|
2859
2849
|
isError: YES
|
2860
|
-
})
|
2850
|
+
});
|
2861
2851
|
|
2862
2852
|
/**
|
2863
2853
|
Creates a new Ember.StoreError instance with the passed description, label, and
|
@@ -2873,8 +2863,8 @@ Ember.StoreError.desc = function(description, label, value, code) {
|
|
2873
2863
|
if (label !== undefined) opts.label = label ;
|
2874
2864
|
if (code !== undefined) opts.code = code ;
|
2875
2865
|
if (value !== undefined) opts.errorValue = value ;
|
2876
|
-
return this.create(opts)
|
2877
|
-
}
|
2866
|
+
return this.create(opts);
|
2867
|
+
};
|
2878
2868
|
|
2879
2869
|
/**
|
2880
2870
|
Shorthand form of the Ember.StoreError.desc method.
|
@@ -2887,7 +2877,7 @@ Ember.StoreError.desc = function(description, label, value, code) {
|
|
2887
2877
|
|
2888
2878
|
Ember.$error = function(description, label, value, c) {
|
2889
2879
|
return Ember.StoreError.desc(description,label, value, c);
|
2890
|
-
}
|
2880
|
+
};
|
2891
2881
|
|
2892
2882
|
/**
|
2893
2883
|
Returns NO if the passed value is an error object or false.
|
@@ -2933,24 +2923,21 @@ Ember.StoreError.HAS_MULTIPLE_VALUES = -100 ;
|
|
2933
2923
|
|
2934
2924
|
(function(exports) {
|
2935
2925
|
// ==========================================================================
|
2936
|
-
// Project:
|
2926
|
+
// Project: Ember DataStore - JavaScript Application Framework
|
2937
2927
|
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
2938
2928
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
2939
2929
|
// License: Licensed under MIT license (see license.js)
|
2940
2930
|
// ==========================================================================
|
2941
|
-
|
2942
|
-
|
2943
|
-
|
2944
2931
|
var get = Ember.get, set = Ember.set, none = Ember.none, copy = Ember.copy, K;
|
2945
2932
|
|
2946
2933
|
/**
|
2947
2934
|
@class
|
2948
2935
|
|
2949
|
-
A Record is the core model class in
|
2936
|
+
A Record is the core model class in Ember. It is analogous to
|
2950
2937
|
NSManagedObject in Core Data and EOEnterpriseObject in the Enterprise
|
2951
2938
|
Objects Framework (aka WebObjects), or ActiveRecord::Base in Rails.
|
2952
2939
|
|
2953
|
-
To create a new model class, in your
|
2940
|
+
To create a new model class, in your Ember workspace, do:
|
2954
2941
|
|
2955
2942
|
$ sc-gen model MyApp.MyModel
|
2956
2943
|
|
@@ -2971,7 +2958,7 @@ var get = Ember.get, set = Ember.set, none = Ember.none, copy = Ember.copy, K;
|
|
2971
2958
|
|
2972
2959
|
@extends Ember.Object
|
2973
2960
|
@see Ember.RecordAttribute
|
2974
|
-
@since
|
2961
|
+
@since Ember 1.0
|
2975
2962
|
*/
|
2976
2963
|
Ember.Record = Ember.Object.extend(
|
2977
2964
|
/** @scope Ember.Record.prototype */ {
|
@@ -4411,14 +4398,11 @@ K = Ember.Record;
|
|
4411
4398
|
|
4412
4399
|
(function(exports) {
|
4413
4400
|
// ==========================================================================
|
4414
|
-
// Project:
|
4401
|
+
// Project: Ember DataStore - JavaScript Application Framework
|
4415
4402
|
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
4416
4403
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
4417
4404
|
// License: Licensed under MIT license (see license.js)
|
4418
4405
|
// ==========================================================================
|
4419
|
-
|
4420
|
-
|
4421
|
-
|
4422
4406
|
var get = Ember.get, set = Ember.set, getPath = Ember.getPath;
|
4423
4407
|
|
4424
4408
|
/** @class
|
@@ -4457,7 +4441,7 @@ var get = Ember.get, set = Ember.set, getPath = Ember.getPath;
|
|
4457
4441
|
@see Ember.Record
|
4458
4442
|
@see Ember.ManyAttribute
|
4459
4443
|
@see Ember.SingleAttribute
|
4460
|
-
@since
|
4444
|
+
@since Ember 1.0
|
4461
4445
|
*/
|
4462
4446
|
Ember.RecordAttribute = Ember.Object.extend(
|
4463
4447
|
/** @scope Ember.RecordAttribute.prototype */ {
|
@@ -4586,7 +4570,7 @@ Ember.RecordAttribute = Ember.Object.extend(
|
|
4586
4570
|
if(klass.superclass && klass.superclass.hasOwnProperty('create')) {
|
4587
4571
|
klass = klass.superclass ;
|
4588
4572
|
}
|
4589
|
-
|
4573
|
+
|
4590
4574
|
// otherwise return the function transform handler
|
4591
4575
|
else klass = 'function' ;
|
4592
4576
|
}
|
@@ -4626,7 +4610,7 @@ Ember.RecordAttribute = Ember.Object.extend(
|
|
4626
4610
|
key: key
|
4627
4611
|
};
|
4628
4612
|
|
4629
|
-
for(i = 0; i < len; i++) Ember.addObserver(value, children[i], this, this.
|
4613
|
+
for(i = 0; i < len; i++) Ember.addObserver(value, children[i], this, this._SCRA_childObserver, context);
|
4630
4614
|
}
|
4631
4615
|
}
|
4632
4616
|
|
@@ -4651,7 +4635,7 @@ Ember.RecordAttribute = Ember.Object.extend(
|
|
4651
4635
|
@param {Object} prev Previous value (not used)
|
4652
4636
|
@param {Object} context Hash of extra context information
|
4653
4637
|
*/
|
4654
|
-
|
4638
|
+
_SCRA_childObserver: function(obj, key, prev, context) {
|
4655
4639
|
// write the new value back to the record
|
4656
4640
|
this.call(context.record, context.key, obj);
|
4657
4641
|
|
@@ -4735,11 +4719,11 @@ Ember.RecordAttribute = Ember.Object.extend(
|
|
4735
4719
|
this.cacheKey = "__cache__" + Ember.guidFor(this) ;
|
4736
4720
|
this.lastSetValueKey = "__lastValue__" + Ember.guidFor(this) ;
|
4737
4721
|
},
|
4738
|
-
|
4739
|
-
/**
|
4740
|
-
@private
|
4741
|
-
|
4742
|
-
Returns a computed property value that can be assigned directly to a
|
4722
|
+
|
4723
|
+
/**
|
4724
|
+
@private
|
4725
|
+
|
4726
|
+
Returns a computed property value that can be assigned directly to a
|
4743
4727
|
property on a record for this attribute.
|
4744
4728
|
*/
|
4745
4729
|
computed: function() {
|
@@ -4816,12 +4800,12 @@ Ember.RecordAttribute.reopenClass(
|
|
4816
4800
|
registerTransform: function(klass, transform) {
|
4817
4801
|
Ember.RecordAttribute.transforms[Ember.guidFor(klass)] = transform;
|
4818
4802
|
},
|
4819
|
-
|
4803
|
+
|
4820
4804
|
/**
|
4821
|
-
Retrieves the original record attribute for the passed key. You can't
|
4822
|
-
use get() to retrieve record attributes because that will invoke the
|
4805
|
+
Retrieves the original record attribute for the passed key. You can't
|
4806
|
+
use get() to retrieve record attributes because that will invoke the
|
4823
4807
|
property instead.
|
4824
|
-
|
4808
|
+
|
4825
4809
|
@param {Ember.Record} rec record instance to inspect
|
4826
4810
|
@param {String} keyName key name to retrieve
|
4827
4811
|
@returns {Ember.RecordAttribute} the attribute or null if none defined
|
@@ -4861,7 +4845,7 @@ Ember.RecordAttribute.registerTransform(String, {
|
|
4861
4845
|
allow null through as that will be checked separately
|
4862
4846
|
*/
|
4863
4847
|
to: function(obj) {
|
4864
|
-
if (
|
4848
|
+
if ((typeof obj !== 'string') && !Ember.none(obj) && obj.toString) {
|
4865
4849
|
obj = obj.toString();
|
4866
4850
|
}
|
4867
4851
|
return obj;
|
@@ -4886,7 +4870,7 @@ Ember.RecordAttribute.registerTransform(Array, {
|
|
4886
4870
|
Ember.RecordAttribute.registerTransform(Object, {
|
4887
4871
|
/** @private - check if obj is an object */
|
4888
4872
|
to: function(obj) {
|
4889
|
-
if (
|
4873
|
+
if ((typeof obj !== 'object') && !Ember.none(obj)) {
|
4890
4874
|
obj = {};
|
4891
4875
|
}
|
4892
4876
|
return obj;
|
@@ -5056,13 +5040,11 @@ Ember.RecordAttribute.registerTransform(Ember.Set, {
|
|
5056
5040
|
|
5057
5041
|
(function(exports) {
|
5058
5042
|
// ==========================================================================
|
5059
|
-
// Project:
|
5043
|
+
// Project: Ember DataStore - JavaScript Application Framework
|
5060
5044
|
// Copyright: ©2010 Evin Grano
|
5061
5045
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
5062
5046
|
// License: Licensed under MIT license (see license.js)
|
5063
5047
|
// ==========================================================================
|
5064
|
-
|
5065
|
-
|
5066
5048
|
var get = Ember.get, set = Ember.set;
|
5067
5049
|
|
5068
5050
|
/** @class
|
@@ -5078,10 +5060,9 @@ var get = Ember.get, set = Ember.set;
|
|
5078
5060
|
contacts: Ember.ChildAttribute.attr('Ember.Child');
|
5079
5061
|
|
5080
5062
|
@extends Ember.RecordAttribute
|
5081
|
-
@since
|
5063
|
+
@since Ember 1.0
|
5082
5064
|
*/
|
5083
|
-
Ember.ChildAttribute = Ember.RecordAttribute.extend(
|
5084
|
-
/** @scope Ember.ChildAttribute.prototype */ {
|
5065
|
+
Ember.ChildAttribute = Ember.RecordAttribute.extend({
|
5085
5066
|
|
5086
5067
|
isNestedRecordTransform: YES,
|
5087
5068
|
|
@@ -5166,7 +5147,7 @@ Ember.ChildAttribute = Ember.RecordAttribute.extend(
|
|
5166
5147
|
|
5167
5148
|
(function(exports) {
|
5168
5149
|
// ==========================================================================
|
5169
|
-
// Project:
|
5150
|
+
// Project: Ember - JavaScript Application Framework
|
5170
5151
|
// Copyright: ©2010 Evin Grano
|
5171
5152
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
5172
5153
|
// License: Licensed under MIT license (see license.js)
|
@@ -5181,7 +5162,7 @@ var get = Ember.get, set = Ember.set, getPath = Ember.getPath;
|
|
5181
5162
|
|
5182
5163
|
@extends Ember.Enumerable
|
5183
5164
|
@extends Ember.Array
|
5184
|
-
@since
|
5165
|
+
@since Ember 1.0
|
5185
5166
|
*/
|
5186
5167
|
|
5187
5168
|
Ember.ChildArray = Ember.Object.extend(Ember.Enumerable, Ember.Array, Ember.MutableEnumerable, Ember.MutableArray,
|
@@ -5360,7 +5341,7 @@ Ember.ChildArray = Ember.Object.extend(Ember.Enumerable, Ember.Array, Ember.Muta
|
|
5360
5341
|
if (me instanceof Ember.Record) {
|
5361
5342
|
store = get(me, 'store');
|
5362
5343
|
sk = get(me, 'storeKey');
|
5363
|
-
if (sk) recs[idx] = store.readDataHash(sk);
|
5344
|
+
if (sk) { recs[idx] = store.readDataHash(sk); }
|
5364
5345
|
}
|
5365
5346
|
});
|
5366
5347
|
|
@@ -5372,7 +5353,7 @@ Ember.ChildArray = Ember.Object.extend(Ember.Enumerable, Ember.Array, Ember.Muta
|
|
5372
5353
|
*/
|
5373
5354
|
normalize: function(){
|
5374
5355
|
this.forEach(function(child,id){
|
5375
|
-
if(child.normalize) child.normalize();
|
5356
|
+
if (child.normalize) { child.normalize(); }
|
5376
5357
|
});
|
5377
5358
|
},
|
5378
5359
|
|
@@ -5441,48 +5422,41 @@ Ember.ChildArray = Ember.Object.extend(Ember.Enumerable, Ember.Array, Ember.Muta
|
|
5441
5422
|
this.recordPropertyDidChange();
|
5442
5423
|
}
|
5443
5424
|
|
5444
|
-
})
|
5445
|
-
|
5425
|
+
});
|
5446
5426
|
|
5447
5427
|
})({});
|
5448
5428
|
|
5449
5429
|
|
5450
5430
|
(function(exports) {
|
5451
5431
|
// ==========================================================================
|
5452
|
-
// Project:
|
5432
|
+
// Project: Ember DataStore - JavaScript Application Framework
|
5453
5433
|
// Copyright: ©2010 Evin Grano
|
5454
5434
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
5455
5435
|
// License: Licensed under MIT license (see license.js)
|
5456
5436
|
// ==========================================================================
|
5457
|
-
|
5458
|
-
|
5459
|
-
|
5460
|
-
|
5461
|
-
|
5462
5437
|
var get = Ember.get, set = Ember.set;
|
5463
5438
|
|
5464
5439
|
/** @class
|
5465
|
-
|
5466
|
-
ChildrenAttribute is a subclass of ChildAttribute and handles to-many
|
5440
|
+
|
5441
|
+
ChildrenAttribute is a subclass of ChildAttribute and handles to-many
|
5467
5442
|
relationships for child records.
|
5468
|
-
|
5443
|
+
|
5469
5444
|
When setting ( `set()` ) the value of a toMany attribute, make sure
|
5470
5445
|
to pass in an array of Ember.Record objects.
|
5471
|
-
|
5446
|
+
|
5472
5447
|
There are many ways you can configure a ChildrenAttribute:
|
5473
|
-
|
5448
|
+
|
5474
5449
|
contacts: Ember.ChildrenAttribute.attr('Ember.Child');
|
5475
|
-
|
5450
|
+
|
5476
5451
|
@extends Ember.RecordAttribute
|
5477
|
-
@since
|
5452
|
+
@since Ember 1.0
|
5478
5453
|
*/
|
5479
|
-
Ember.ChildrenAttribute = Ember.ChildAttribute.extend(
|
5480
|
-
|
5481
|
-
|
5454
|
+
Ember.ChildrenAttribute = Ember.ChildAttribute.extend({
|
5455
|
+
|
5482
5456
|
// ..........................................................
|
5483
5457
|
// LOW-LEVEL METHODS
|
5484
5458
|
//
|
5485
|
-
|
5459
|
+
|
5486
5460
|
/** @private - adapted for to many relationship */
|
5487
5461
|
toType: function(record, key, value) {
|
5488
5462
|
var attrKey = get(this, 'key') || key,
|
@@ -5490,10 +5464,10 @@ Ember.ChildrenAttribute = Ember.ChildAttribute.extend(
|
|
5490
5464
|
ret = record[arrayKey],
|
5491
5465
|
recordType = get(this, 'typeClass'), rel;
|
5492
5466
|
|
5493
|
-
// lazily create a ManyArray one time. after that always return the
|
5467
|
+
// lazily create a ManyArray one time. after that always return the
|
5494
5468
|
// same object.
|
5495
5469
|
if (!ret) {
|
5496
|
-
ret = Ember.ChildArray.create({
|
5470
|
+
ret = Ember.ChildArray.create({
|
5497
5471
|
record: record,
|
5498
5472
|
propertyName: attrKey,
|
5499
5473
|
defaultRecordType: recordType
|
@@ -5507,17 +5481,17 @@ Ember.ChildrenAttribute = Ember.ChildAttribute.extend(
|
|
5507
5481
|
|
5508
5482
|
return ret;
|
5509
5483
|
},
|
5510
|
-
|
5484
|
+
|
5511
5485
|
// Default fromType is just returning itself
|
5512
5486
|
fromType: function(record, key, value){
|
5513
|
-
var sk, store,
|
5487
|
+
var sk, store,
|
5514
5488
|
arrayKey = '__kidsArray__'+Ember.guidFor(this),
|
5515
5489
|
ret = record[arrayKey];
|
5516
5490
|
if (record) {
|
5517
5491
|
record.writeAttribute(key, value);
|
5518
5492
|
if (ret) ret = ret.recordPropertyDidChange();
|
5519
5493
|
}
|
5520
|
-
|
5494
|
+
|
5521
5495
|
return ret;
|
5522
5496
|
}
|
5523
5497
|
});
|
@@ -5529,12 +5503,11 @@ Ember.ChildrenAttribute = Ember.ChildAttribute.extend(
|
|
5529
5503
|
|
5530
5504
|
(function(exports) {
|
5531
5505
|
// ==========================================================================
|
5532
|
-
// Project:
|
5506
|
+
// Project: Ember DataStore - JavaScript Application Framework
|
5533
5507
|
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
5534
5508
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
5535
5509
|
// License: Licensed under MIT license (see license.js)
|
5536
5510
|
// ==========================================================================
|
5537
|
-
|
5538
5511
|
var get = Ember.get, set = Ember.set, attrFor = Ember.RecordAttribute.attrFor;
|
5539
5512
|
|
5540
5513
|
/**
|
@@ -5549,7 +5522,7 @@ var get = Ember.get, set = Ember.set, attrFor = Ember.RecordAttribute.attrFor;
|
|
5549
5522
|
|
5550
5523
|
@extends Ember.Enumerable
|
5551
5524
|
@extends Ember.Array
|
5552
|
-
@since
|
5525
|
+
@since Ember 1.0
|
5553
5526
|
*/
|
5554
5527
|
|
5555
5528
|
Ember.ManyArray = Ember.Object.extend(Ember.Enumerable, Ember.MutableEnumerable, Ember.MutableArray, Ember.Array,
|
@@ -5994,22 +5967,18 @@ Ember.ManyArray = Ember.Object.extend(Ember.Enumerable, Ember.MutableEnumerable,
|
|
5994
5967
|
this.recordPropertyDidChange();
|
5995
5968
|
}
|
5996
5969
|
|
5997
|
-
})
|
5998
|
-
|
5970
|
+
});
|
5999
5971
|
|
6000
5972
|
})({});
|
6001
5973
|
|
6002
5974
|
|
6003
5975
|
(function(exports) {
|
6004
5976
|
// ==========================================================================
|
6005
|
-
// Project:
|
5977
|
+
// Project: Ember DataStore - JavaScript Application Framework
|
6006
5978
|
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
6007
5979
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
6008
5980
|
// License: Licensed under MIT license (see license.js)
|
6009
5981
|
// ==========================================================================
|
6010
|
-
|
6011
|
-
|
6012
|
-
|
6013
5982
|
var get = Ember.get, set = Ember.set;
|
6014
5983
|
|
6015
5984
|
/** @class
|
@@ -6031,7 +6000,7 @@ var get = Ember.get, set = Ember.set;
|
|
6031
6000
|
});
|
6032
6001
|
|
6033
6002
|
@extends Ember.RecordAttribute
|
6034
|
-
@since
|
6003
|
+
@since Ember 1.0
|
6035
6004
|
*/
|
6036
6005
|
Ember.ManyAttribute = Ember.RecordAttribute.extend(
|
6037
6006
|
/** @scope Ember.ManyAttribute.prototype */ {
|
@@ -6160,13 +6129,11 @@ Ember.ManyAttribute = Ember.RecordAttribute.extend(
|
|
6160
6129
|
|
6161
6130
|
(function(exports) {
|
6162
6131
|
// ==========================================================================
|
6163
|
-
// Project:
|
6132
|
+
// Project: Ember DataStore - JavaScript Application Framework
|
6164
6133
|
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
6165
6134
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
6166
6135
|
// License: Licensed under MIT license (see license.js)
|
6167
6136
|
// ==========================================================================
|
6168
|
-
|
6169
|
-
|
6170
6137
|
var get = Ember.get, set = Ember.set;
|
6171
6138
|
var RecordAttribute_call = get(Ember.RecordAttribute, 'proto').call;
|
6172
6139
|
var attrFor = Ember.RecordAttribute.attrFor;
|
@@ -6186,7 +6153,7 @@ var attrFor = Ember.RecordAttribute.attrFor;
|
|
6186
6153
|
});
|
6187
6154
|
|
6188
6155
|
@extends Ember.RecordAttribute
|
6189
|
-
@since
|
6156
|
+
@since Ember 1.0
|
6190
6157
|
*/
|
6191
6158
|
Ember.SingleAttribute = Ember.RecordAttribute.extend(
|
6192
6159
|
/** @scope Ember.SingleAttribute.prototype */ {
|
@@ -6322,27 +6289,21 @@ Ember.SingleAttribute = Ember.RecordAttribute.extend(
|
|
6322
6289
|
|
6323
6290
|
(function(exports) {
|
6324
6291
|
// ==========================================================================
|
6325
|
-
// Project:
|
6292
|
+
// Project: Ember DataStore
|
6326
6293
|
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
6327
6294
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
6328
6295
|
// License: Licensed under MIT license (see license.js)
|
6329
6296
|
// ==========================================================================
|
6330
|
-
|
6331
|
-
|
6332
|
-
|
6333
|
-
|
6334
|
-
|
6335
6297
|
})({});
|
6336
6298
|
|
6337
6299
|
|
6338
6300
|
(function(exports) {
|
6339
6301
|
// ==========================================================================
|
6340
|
-
// Project:
|
6302
|
+
// Project: Ember DataStore - JavaScript Application Framework
|
6341
6303
|
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
6342
6304
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
6343
6305
|
// License: Licensed under MIT license (see license.js)
|
6344
6306
|
// ==========================================================================
|
6345
|
-
|
6346
6307
|
/**
|
6347
6308
|
Indicates a value has a mixed state of both on and off.
|
6348
6309
|
|
@@ -6369,7 +6330,7 @@ Ember.MIXED_STATE = '__MIXED__';
|
|
6369
6330
|
|
6370
6331
|
## Connect to a Data Source
|
6371
6332
|
|
6372
|
-
New
|
6333
|
+
New Ember applications are wired up to fixtures as their data source.
|
6373
6334
|
When you are ready to connect to a server, swap the use of fixtures with a
|
6374
6335
|
call to the desired data source.
|
6375
6336
|
|
@@ -6545,9 +6506,9 @@ Ember.MIXED_STATE = '__MIXED__';
|
|
6545
6506
|
(or a promise to provide store keys) that comprises the result set.
|
6546
6507
|
|
6547
6508
|
@extend Ember.Object
|
6548
|
-
@since
|
6509
|
+
@since Ember DataStore 0.9
|
6549
6510
|
*/
|
6550
|
-
Ember.DataSource = Ember.Object.extend(
|
6511
|
+
Ember.DataSource = Ember.Object.extend({
|
6551
6512
|
|
6552
6513
|
// ..........................................................
|
6553
6514
|
// Ember.STORE ENTRY POINTS
|
@@ -6621,7 +6582,7 @@ Ember.DataSource = Ember.Object.extend( /** @scope Ember.DataSource.prototype */
|
|
6621
6582
|
@returns {Boolean} YES if you can handle fetching the query, NO otherwise
|
6622
6583
|
*/
|
6623
6584
|
fetch: function(store, query) {
|
6624
|
-
return NO
|
6585
|
+
return NO; // do not handle anything!
|
6625
6586
|
},
|
6626
6587
|
|
6627
6588
|
/**
|
@@ -6789,19 +6750,19 @@ Ember.DataSource = Ember.Object.extend( /** @scope Ember.DataSource.prototype */
|
|
6789
6750
|
_handleEach: function(store, storeKeys, action, ids, params) {
|
6790
6751
|
var len = storeKeys.length, idx, ret, cur, idOrParams;
|
6791
6752
|
|
6792
|
-
for(idx=0;idx<len;idx++) {
|
6753
|
+
for (idx=0;idx<len;idx++) {
|
6793
6754
|
idOrParams = ids ? ids[idx] : params;
|
6794
6755
|
|
6795
6756
|
cur = action.call(this, store, storeKeys[idx], idOrParams);
|
6796
6757
|
if (ret === undefined) {
|
6797
6758
|
ret = cur ;
|
6798
6759
|
} else if (ret === YES) {
|
6799
|
-
ret = (cur === YES) ? YES : Ember.MIXED_STATE
|
6760
|
+
ret = (cur === YES) ? YES : Ember.MIXED_STATE;
|
6800
6761
|
} else if (ret === NO) {
|
6801
|
-
ret = (cur === NO) ? NO : Ember.MIXED_STATE
|
6762
|
+
ret = (cur === NO) ? NO : Ember.MIXED_STATE;
|
6802
6763
|
}
|
6803
6764
|
}
|
6804
|
-
return !Ember.none(ret) ? ret : null
|
6765
|
+
return !Ember.none(ret) ? ret : null;
|
6805
6766
|
},
|
6806
6767
|
|
6807
6768
|
|
@@ -6823,7 +6784,7 @@ Ember.DataSource = Ember.Object.extend( /** @scope Ember.DataSource.prototype */
|
|
6823
6784
|
@returns {Boolean} YES if handled
|
6824
6785
|
*/
|
6825
6786
|
updateRecord: function(store, storeKey, params) {
|
6826
|
-
return NO
|
6787
|
+
return NO;
|
6827
6788
|
},
|
6828
6789
|
|
6829
6790
|
/**
|
@@ -6835,7 +6796,7 @@ Ember.DataSource = Ember.Object.extend( /** @scope Ember.DataSource.prototype */
|
|
6835
6796
|
@returns {Boolean} YES if handled
|
6836
6797
|
*/
|
6837
6798
|
retrieveRecord: function(store, storeKey, id) {
|
6838
|
-
return NO
|
6799
|
+
return NO;
|
6839
6800
|
},
|
6840
6801
|
|
6841
6802
|
/**
|
@@ -6852,7 +6813,7 @@ Ember.DataSource = Ember.Object.extend( /** @scope Ember.DataSource.prototype */
|
|
6852
6813
|
@returns {Boolean} YES if handled
|
6853
6814
|
*/
|
6854
6815
|
createRecord: function(store, storeKey, params) {
|
6855
|
-
return NO
|
6816
|
+
return NO;
|
6856
6817
|
},
|
6857
6818
|
|
6858
6819
|
/**
|
@@ -6869,24 +6830,21 @@ Ember.DataSource = Ember.Object.extend( /** @scope Ember.DataSource.prototype */
|
|
6869
6830
|
@returns {Boolean} YES if handled
|
6870
6831
|
*/
|
6871
6832
|
destroyRecord: function(store, storeKey, params) {
|
6872
|
-
return NO
|
6833
|
+
return NO;
|
6873
6834
|
}
|
6874
6835
|
|
6875
6836
|
});
|
6876
6837
|
|
6877
|
-
|
6878
6838
|
})({});
|
6879
6839
|
|
6880
6840
|
|
6881
6841
|
(function(exports) {
|
6882
6842
|
// ==========================================================================
|
6883
|
-
// Project:
|
6843
|
+
// Project: Ember DataStore - JavaScript Application Framework
|
6884
6844
|
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
6885
6845
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
6886
6846
|
// License: Licensed under MIT license (see license.js)
|
6887
6847
|
// ==========================================================================
|
6888
|
-
|
6889
|
-
|
6890
6848
|
var get = Ember.get, set = Ember.set;
|
6891
6849
|
|
6892
6850
|
/** @class
|
@@ -6931,10 +6889,9 @@ var get = Ember.get, set = Ember.set;
|
|
6931
6889
|
will cascade.
|
6932
6890
|
|
6933
6891
|
@extends Ember.DataSource
|
6934
|
-
@since
|
6892
|
+
@since Ember 1.0
|
6935
6893
|
*/
|
6936
|
-
Ember.CascadeDataSource = Ember.DataSource.extend(
|
6937
|
-
/** @scope Ember.CascadeDataSource.prototype */ {
|
6894
|
+
Ember.CascadeDataSource = Ember.DataSource.extend({
|
6938
6895
|
|
6939
6896
|
/**
|
6940
6897
|
The data sources used by the cascade, in the order that they are to be
|
@@ -6956,7 +6913,7 @@ Ember.CascadeDataSource = Ember.DataSource.extend(
|
|
6956
6913
|
var dataSources = get(this, 'dataSources');
|
6957
6914
|
if (!dataSources) set(this, 'dataSources', dataSources = []);
|
6958
6915
|
dataSources.push(dataSource);
|
6959
|
-
return this
|
6916
|
+
return this;
|
6960
6917
|
},
|
6961
6918
|
|
6962
6919
|
// ..........................................................
|
@@ -6970,13 +6927,13 @@ Ember.CascadeDataSource = Ember.DataSource.extend(
|
|
6970
6927
|
ret = NO,
|
6971
6928
|
cur, source, idx;
|
6972
6929
|
|
6973
|
-
for(idx=0; (ret !== YES) && idx<len; idx++) {
|
6930
|
+
for (idx=0; (ret !== YES) && idx<len; idx++) {
|
6974
6931
|
source = sources.objectAt(idx);
|
6975
6932
|
cur = source.fetch ? source.fetch.apply(source, arguments) : NO;
|
6976
6933
|
ret = this._handleResponse(ret, cur);
|
6977
6934
|
}
|
6978
6935
|
|
6979
|
-
return ret
|
6936
|
+
return ret;
|
6980
6937
|
},
|
6981
6938
|
|
6982
6939
|
|
@@ -6987,13 +6944,13 @@ Ember.CascadeDataSource = Ember.DataSource.extend(
|
|
6987
6944
|
ret = NO,
|
6988
6945
|
cur, source, idx;
|
6989
6946
|
|
6990
|
-
for(idx=0; (ret !== YES) && idx<len; idx++) {
|
6947
|
+
for (idx=0; (ret !== YES) && idx<len; idx++) {
|
6991
6948
|
source = sources.objectAt(idx);
|
6992
6949
|
cur = source.retrieveRecords.apply(source, arguments);
|
6993
6950
|
ret = this._handleResponse(ret, cur);
|
6994
6951
|
}
|
6995
6952
|
|
6996
|
-
return ret
|
6953
|
+
return ret;
|
6997
6954
|
},
|
6998
6955
|
|
6999
6956
|
/** @private - just cascades */
|
@@ -7003,13 +6960,13 @@ Ember.CascadeDataSource = Ember.DataSource.extend(
|
|
7003
6960
|
ret = NO,
|
7004
6961
|
cur, source, idx;
|
7005
6962
|
|
7006
|
-
for(idx=0; (ret !== YES) && idx<len; idx++) {
|
6963
|
+
for (idx=0; (ret !== YES) && idx<len; idx++) {
|
7007
6964
|
source = sources.objectAt(idx);
|
7008
6965
|
cur = source.commitRecords.apply(source, arguments);
|
7009
6966
|
ret = this._handleResponse(ret, cur);
|
7010
6967
|
}
|
7011
6968
|
|
7012
|
-
return ret
|
6969
|
+
return ret;
|
7013
6970
|
},
|
7014
6971
|
|
7015
6972
|
/** @private - just cascades */
|
@@ -7019,13 +6976,13 @@ Ember.CascadeDataSource = Ember.DataSource.extend(
|
|
7019
6976
|
ret = NO,
|
7020
6977
|
cur, source, idx;
|
7021
6978
|
|
7022
|
-
for(idx=0; (ret !== YES) && idx<len; idx++) {
|
6979
|
+
for (idx=0; (ret !== YES) && idx<len; idx++) {
|
7023
6980
|
source = sources.objectAt(idx);
|
7024
6981
|
cur = source.cancel.apply(source, arguments);
|
7025
6982
|
ret = this._handleResponse(ret, cur);
|
7026
6983
|
}
|
7027
6984
|
|
7028
|
-
return ret
|
6985
|
+
return ret;
|
7029
6986
|
},
|
7030
6987
|
|
7031
6988
|
// ..........................................................
|
@@ -7041,7 +6998,7 @@ Ember.CascadeDataSource = Ember.DataSource.extend(
|
|
7041
6998
|
var sources = get(this, 'dataSources'),
|
7042
6999
|
idx = sources ? get(sources, 'length') : 0,
|
7043
7000
|
source;
|
7044
|
-
while(--idx>=0) {
|
7001
|
+
while (--idx>=0) {
|
7045
7002
|
source = sources[idx];
|
7046
7003
|
if (Ember.typeOf(source) === 'string') sources[idx] = get(this, source);
|
7047
7004
|
}
|
@@ -7051,8 +7008,8 @@ Ember.CascadeDataSource = Ember.DataSource.extend(
|
|
7051
7008
|
/** @private - Determine the proper return value. */
|
7052
7009
|
_handleResponse: function(current, response) {
|
7053
7010
|
if (response === YES) return YES ;
|
7054
|
-
else if (current === NO) return (response === NO) ? NO : Ember.MIXED_STATE
|
7055
|
-
else return Ember.MIXED_STATE
|
7011
|
+
else if (current === NO) return (response === NO) ? NO : Ember.MIXED_STATE;
|
7012
|
+
else return Ember.MIXED_STATE;
|
7056
7013
|
}
|
7057
7014
|
|
7058
7015
|
});
|
@@ -7063,15 +7020,11 @@ Ember.CascadeDataSource = Ember.DataSource.extend(
|
|
7063
7020
|
|
7064
7021
|
(function(exports) {
|
7065
7022
|
// ==========================================================================
|
7066
|
-
// Project:
|
7023
|
+
// Project: Ember DataStore - JavaScript Application Framework
|
7067
7024
|
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
7068
7025
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
7069
7026
|
// License: Licensed under MIT license (see license.js)
|
7070
7027
|
// ==========================================================================
|
7071
|
-
|
7072
|
-
|
7073
|
-
|
7074
|
-
|
7075
7028
|
var get = Ember.get, set = Ember.set, getPath = Ember.getPath;
|
7076
7029
|
|
7077
7030
|
/** @class
|
@@ -7079,10 +7032,9 @@ var get = Ember.get, set = Ember.set, getPath = Ember.getPath;
|
|
7079
7032
|
TODO: Describe Class
|
7080
7033
|
|
7081
7034
|
@extends Ember.DataSource
|
7082
|
-
@since
|
7035
|
+
@since Ember 1.0
|
7083
7036
|
*/
|
7084
|
-
Ember.FixturesDataSource = Ember.DataSource.extend(
|
7085
|
-
/** @scope Ember.FixturesDataSource.prototype */ {
|
7037
|
+
Ember.FixturesDataSource = Ember.DataSource.extend({
|
7086
7038
|
|
7087
7039
|
/**
|
7088
7040
|
If YES then the data source will asynchronously respond to data requests
|
@@ -7190,7 +7142,7 @@ Ember.FixturesDataSource = Ember.DataSource.extend(
|
|
7190
7142
|
}, latency);
|
7191
7143
|
} else this._retrieveRecords(store, storeKeys);
|
7192
7144
|
|
7193
|
-
return ret
|
7145
|
+
return ret;
|
7194
7146
|
},
|
7195
7147
|
|
7196
7148
|
_retrieveRecords: function(store, storeKeys) {
|
@@ -7224,7 +7176,7 @@ Ember.FixturesDataSource = Ember.DataSource.extend(
|
|
7224
7176
|
}, latency);
|
7225
7177
|
} else this._updateRecords(store, storeKeys);
|
7226
7178
|
|
7227
|
-
return ret
|
7179
|
+
return ret;
|
7228
7180
|
},
|
7229
7181
|
|
7230
7182
|
_updateRecords: function(store, storeKeys) {
|
@@ -7253,7 +7205,7 @@ Ember.FixturesDataSource = Ember.DataSource.extend(
|
|
7253
7205
|
}, latency);
|
7254
7206
|
} else this._createRecords(store, storeKeys);
|
7255
7207
|
|
7256
|
-
return YES
|
7208
|
+
return YES;
|
7257
7209
|
},
|
7258
7210
|
|
7259
7211
|
_createRecords: function(store, storeKeys) {
|
@@ -7290,7 +7242,7 @@ Ember.FixturesDataSource = Ember.DataSource.extend(
|
|
7290
7242
|
}, latency);
|
7291
7243
|
} else this._destroyRecords(store, storeKeys);
|
7292
7244
|
|
7293
|
-
return ret
|
7245
|
+
return ret;
|
7294
7246
|
},
|
7295
7247
|
|
7296
7248
|
|
@@ -7336,7 +7288,7 @@ Ember.FixturesDataSource = Ember.DataSource.extend(
|
|
7336
7288
|
// only load records that were not already loaded to avoid infinite loops
|
7337
7289
|
if (hashes && hashes.length>0) store.loadRecords(recordType, hashes);
|
7338
7290
|
|
7339
|
-
return this
|
7291
|
+
return this;
|
7340
7292
|
},
|
7341
7293
|
|
7342
7294
|
|
@@ -7382,7 +7334,7 @@ Ember.FixturesDataSource = Ember.DataSource.extend(
|
|
7382
7334
|
fixtures = this.fixturesFor(recordType);
|
7383
7335
|
this._invalidateCachesFor(recordType, storeKey, id);
|
7384
7336
|
fixtures[id] = dataHash;
|
7385
|
-
return this
|
7337
|
+
return this;
|
7386
7338
|
},
|
7387
7339
|
|
7388
7340
|
/**
|
@@ -7445,7 +7397,7 @@ Ember.FixturesDataSource = Ember.DataSource.extend(
|
|
7445
7397
|
}
|
7446
7398
|
}, this);
|
7447
7399
|
|
7448
|
-
return ret
|
7400
|
+
return ret;
|
7449
7401
|
},
|
7450
7402
|
|
7451
7403
|
/** @private
|
@@ -7461,7 +7413,7 @@ Ember.FixturesDataSource = Ember.DataSource.extend(
|
|
7461
7413
|
_invalidateCachesFor: function(recordType, storeKey, id) {
|
7462
7414
|
var cache = this._storeKeyCache;
|
7463
7415
|
if (cache) delete cache[Ember.guidFor(recordType)];
|
7464
|
-
return this
|
7416
|
+
return this;
|
7465
7417
|
}
|
7466
7418
|
|
7467
7419
|
});
|
@@ -7479,28 +7431,21 @@ Ember.Record.fixtures = Ember.FixturesDataSource.create();
|
|
7479
7431
|
|
7480
7432
|
(function(exports) {
|
7481
7433
|
// ==========================================================================
|
7482
|
-
// Project:
|
7434
|
+
// Project: Ember DataStore
|
7483
7435
|
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
7484
7436
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
7485
7437
|
// License: Licensed under MIT license (see license.js)
|
7486
7438
|
// ==========================================================================
|
7487
|
-
|
7488
|
-
|
7489
|
-
|
7490
7439
|
})({});
|
7491
7440
|
|
7492
7441
|
|
7493
7442
|
(function(exports) {
|
7494
7443
|
// ==========================================================================
|
7495
|
-
// Project:
|
7444
|
+
// Project: Ember DataStore - JavaScript Application Framework
|
7496
7445
|
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
7497
7446
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
7498
7447
|
// License: Licensed under MIT license (see license.js)
|
7499
7448
|
// ==========================================================================
|
7500
|
-
|
7501
|
-
|
7502
|
-
|
7503
|
-
|
7504
7449
|
var get = Ember.get, set = Ember.set;
|
7505
7450
|
|
7506
7451
|
/**
|
@@ -7546,7 +7491,7 @@ var get = Ember.get, set = Ember.set;
|
|
7546
7491
|
@extends Ember.Object
|
7547
7492
|
@extends Ember.Enumerable
|
7548
7493
|
@extends Ember.Array
|
7549
|
-
@since
|
7494
|
+
@since Ember 1.0
|
7550
7495
|
*/
|
7551
7496
|
|
7552
7497
|
Ember.RecordArray = Ember.Object.extend(Ember.Enumerable, Ember.Array, Ember.MutableEnumerable, Ember.MutableArray,
|
@@ -7969,7 +7914,7 @@ Ember.RecordArray = Ember.Object.extend(Ember.Enumerable, Ember.Array, Ember.Mut
|
|
7969
7914
|
@returns {Ember.RecordArray} receiver
|
7970
7915
|
*/
|
7971
7916
|
flush: function(_flush) {
|
7972
|
-
|
7917
|
+
|
7973
7918
|
// Are we already inside a flush? If so, then don't do it again, to avoid
|
7974
7919
|
// never-ending recursive flush calls. Instead, we'll simply mark
|
7975
7920
|
// ourselves as needing a flush again when we're done.
|
@@ -7980,7 +7925,7 @@ Ember.RecordArray = Ember.Object.extend(Ember.Enumerable, Ember.Array, Ember.Mut
|
|
7980
7925
|
|
7981
7926
|
if (!get(this, 'needsFlush') && !_flush) return this; // nothing to do
|
7982
7927
|
set(this, 'needsFlush', NO); // avoid running again.
|
7983
|
-
|
7928
|
+
|
7984
7929
|
// fast exit
|
7985
7930
|
var query = get(this, 'query'),
|
7986
7931
|
store = get(this, 'store');
|
@@ -8224,7 +8169,7 @@ Ember.RecordArray = Ember.Object.extend(Ember.Enumerable, Ember.Array, Ember.Mut
|
|
8224
8169
|
_storeKeysContentWillChange: function(target, start, removedCount, addedCount) {
|
8225
8170
|
this.arrayContentWillChange(start, removedCount, addedCount);
|
8226
8171
|
},
|
8227
|
-
|
8172
|
+
|
8228
8173
|
/** @private
|
8229
8174
|
Invoked whenever the content of the `storeKeys` array changes. This will
|
8230
8175
|
dump any cached record lookup and then notify that the enumerable content
|
@@ -8269,16 +8214,11 @@ Ember.RecordArray.reopenClass(/** @scope Ember.RecordArray.prototype */{
|
|
8269
8214
|
|
8270
8215
|
(function(exports) {
|
8271
8216
|
// ==========================================================================
|
8272
|
-
// Project:
|
8217
|
+
// Project: Ember DataStore - JavaScript Application Framework
|
8273
8218
|
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
8274
8219
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
8275
8220
|
// License: Licensed under MIT license (see license.js)
|
8276
8221
|
// ==========================================================================
|
8277
|
-
/*globals sc_assert */
|
8278
|
-
|
8279
|
-
|
8280
|
-
|
8281
|
-
|
8282
8222
|
var get = Ember.get, set = Ember.set, getPath = Ember.getPath, none = Ember.none;
|
8283
8223
|
|
8284
8224
|
/**
|
@@ -8298,7 +8238,7 @@ var get = Ember.get, set = Ember.set, getPath = Ember.getPath, none = Ember.none
|
|
8298
8238
|
be a server, local storage, or any other persistent code.
|
8299
8239
|
|
8300
8240
|
@extends Ember.Object
|
8301
|
-
@since
|
8241
|
+
@since Ember 1.0
|
8302
8242
|
*/
|
8303
8243
|
Ember.Store = Ember.Object.extend( /** @scope Ember.Store.prototype */ {
|
8304
8244
|
|
@@ -8410,15 +8350,13 @@ Ember.Store = Ember.Object.extend( /** @scope Ember.Store.prototype */ {
|
|
8410
8350
|
*/
|
8411
8351
|
chain: function(attrs, newStoreClass) {
|
8412
8352
|
if (!attrs) attrs = {};
|
8413
|
-
|
8353
|
+
|
8414
8354
|
attrs.parentStore = this;
|
8415
8355
|
if (!newStoreClass) newStoreClass = Ember.NestedStore;
|
8416
8356
|
|
8417
8357
|
// Ensure the passed-in class is a type of nested store.
|
8418
|
-
|
8419
|
-
|
8420
|
-
sc_assert("%@ is a type of Ember.NestedStore".fmt(newStoreClass),
|
8421
|
-
Ember.NestedStore.detect(newStoreClass));
|
8358
|
+
ember_assert("%@ is a valid class".fmt(newStoreClass), Ember.typeOf(newStoreClass) === 'class');
|
8359
|
+
ember_assert("%@ is a type of Ember.NestedStore".fmt(newStoreClass), Ember.NestedStore.detect(newStoreClass));
|
8422
8360
|
|
8423
8361
|
// Replicate parent records references
|
8424
8362
|
attrs.childRecords = this.childRecords ? Ember.copy(this.childRecords) : {};
|
@@ -8774,11 +8712,11 @@ Ember.Store = Ember.Object.extend( /** @scope Ember.Store.prototype */ {
|
|
8774
8712
|
}
|
8775
8713
|
|
8776
8714
|
var that = this;
|
8777
|
-
|
8715
|
+
|
8778
8716
|
function iter(storeKey){
|
8779
8717
|
that.dataHashDidChange(storeKey, null, statusOnly, key);
|
8780
8718
|
}
|
8781
|
-
|
8719
|
+
|
8782
8720
|
for(idx=0;idx<len;idx++) {
|
8783
8721
|
if (isArray) storeKey = storeKeys[idx];
|
8784
8722
|
this.revisions[storeKey] = rev;
|
@@ -9119,13 +9057,12 @@ Ember.Store = Ember.Object.extend( /** @scope Ember.Store.prototype */ {
|
|
9119
9057
|
|
9120
9058
|
// handle passing a query...
|
9121
9059
|
if (id === undefined && !(recordType instanceof Ember.Record)) {
|
9122
|
-
|
9123
|
-
Ember.Record.detect(recordType) || recordType instanceof Ember.Query);
|
9060
|
+
ember_assert('Ember.Store#find() accepts only a record type of query', Ember.Record.detect(recordType) || recordType instanceof Ember.Query);
|
9124
9061
|
|
9125
9062
|
if (!(recordType instanceof Ember.Query)) {
|
9126
9063
|
recordType = Ember.Query.local(recordType);
|
9127
9064
|
}
|
9128
|
-
|
9065
|
+
|
9129
9066
|
return this._findQuery(recordType, YES, YES);
|
9130
9067
|
|
9131
9068
|
// handle finding a single record
|
@@ -9138,15 +9075,15 @@ Ember.Store = Ember.Object.extend( /** @scope Ember.Store.prototype */ {
|
|
9138
9075
|
DEPRECATED used find() instead.
|
9139
9076
|
|
9140
9077
|
This method will accept a record type or query and return a record array
|
9141
|
-
matching the results. This method was commonly used prior to
|
9078
|
+
matching the results. This method was commonly used prior to Ember
|
9142
9079
|
1.0. It has been deprecated in favor of a single `find()` method instead.
|
9143
9080
|
|
9144
|
-
For compatibility, this method will continue to work in
|
9081
|
+
For compatibility, this method will continue to work in Ember 1.0 but
|
9145
9082
|
it will raise a warning. It will be removed in a future version of
|
9146
|
-
|
9083
|
+
Ember.
|
9147
9084
|
*/
|
9148
9085
|
findAll: function(recordType, conditions, params) {
|
9149
|
-
Ember.Logger.warn("Ember.Store#findAll() will be removed in a future version of
|
9086
|
+
Ember.Logger.warn("Ember.Store#findAll() will be removed in a future version of Ember. Use Ember.Store#find() instead");
|
9150
9087
|
|
9151
9088
|
|
9152
9089
|
if (!recordType || !recordType.isQuery) {
|
@@ -9578,8 +9515,12 @@ Ember.Store = Ember.Object.extend( /** @scope Ember.Store.prototype */ {
|
|
9578
9515
|
changelog = this.changelog;
|
9579
9516
|
if (!changelog) changelog = this.changelog = Ember.Set.create();
|
9580
9517
|
|
9581
|
-
(
|
9582
|
-
|
9518
|
+
if (status & K.DIRTY) {
|
9519
|
+
changelog.add(storeKey);
|
9520
|
+
} else {
|
9521
|
+
changelog.remove(storeKey);
|
9522
|
+
}
|
9523
|
+
this.changelog = changelog;
|
9583
9524
|
|
9584
9525
|
// if commit records is enabled
|
9585
9526
|
if(get(this, 'commitRecordsAutomatically')){
|
@@ -10234,7 +10175,7 @@ Ember.Store = Ember.Object.extend( /** @scope Ember.Store.prototype */ {
|
|
10234
10175
|
The return value will be the `storeKey` used for the push. This is often
|
10235
10176
|
convenient to pass into `loadQuery()`, if you are fetching a remote query.
|
10236
10177
|
|
10237
|
-
If you are upgrading from a pre
|
10178
|
+
If you are upgrading from a pre Ember 1.0 application, this method
|
10238
10179
|
is the closest to the old `updateRecord()`.
|
10239
10180
|
|
10240
10181
|
@param {Ember.Record} recordType the record type
|
@@ -10280,7 +10221,7 @@ Ember.Store = Ember.Object.extend( /** @scope Ember.Store.prototype */ {
|
|
10280
10221
|
The return value will be the storeKeys used for each push. This is often
|
10281
10222
|
convenient to pass into `loadQuery()`, if you are fetching a remote query.
|
10282
10223
|
|
10283
|
-
If you are upgrading from a pre
|
10224
|
+
If you are upgrading from a pre Ember 1.0 application, this method
|
10284
10225
|
is the closest to the old `updateRecords()`.
|
10285
10226
|
|
10286
10227
|
@param {Ember.Record} recordTypes the record type or array of record types
|
@@ -11053,106 +10994,16 @@ Ember.Store.reopen({
|
|
11053
10994
|
nextStoreIndex: 1
|
11054
10995
|
});
|
11055
10996
|
|
11056
|
-
// ..........................................................
|
11057
|
-
// COMPATIBILITY
|
11058
|
-
//
|
11059
|
-
|
11060
|
-
/** @private
|
11061
|
-
global store is used only for deprecated compatibility methods. Don't use
|
11062
|
-
this in real code.
|
11063
|
-
*/
|
11064
|
-
Ember.Store._getDefaultStore = function() {
|
11065
|
-
var store = this._store;
|
11066
|
-
if(!store) this._store = store = Ember.Store.create();
|
11067
|
-
return store;
|
11068
|
-
};
|
11069
|
-
|
11070
|
-
/** @private
|
11071
|
-
|
11072
|
-
DEPRECATED
|
11073
|
-
|
11074
|
-
Included for compatibility, loads data hashes with the named `recordType`.
|
11075
|
-
If no `recordType` is passed, expects to find a `recordType` property in the
|
11076
|
-
data hashes. `dataSource` and `isLoaded` params are ignored.
|
11077
|
-
|
11078
|
-
Calls `Ember.Store#loadRecords()` on the default store. Do not use this method in
|
11079
|
-
new code.
|
11080
|
-
|
11081
|
-
@param {Array} dataHashes data hashes to import
|
11082
|
-
@param {Object} dataSource ignored
|
11083
|
-
@param {Ember.Record} recordType default record type
|
11084
|
-
@param {Boolean} isLoaded ignored
|
11085
|
-
@returns {Array} Ember.Record instances for loaded data hashes
|
11086
|
-
*/
|
11087
|
-
Ember.Store.updateRecords = function(dataHashes, dataSource, recordType, isLoaded) {
|
11088
|
-
|
11089
|
-
Ember.Logger.warn("Ember.Store.updateRecords() is deprecated. Use loadRecords() instead");
|
11090
|
-
|
11091
|
-
var store = this._getDefaultStore(),
|
11092
|
-
len = dataHashes.length,
|
11093
|
-
idx, ret;
|
11094
|
-
|
11095
|
-
// if no recordType was passed, build an array of recordTypes from hashes
|
11096
|
-
if (!recordType) {
|
11097
|
-
recordType = [];
|
11098
|
-
for(idx=0;idx<len;idx++) recordType[idx] = dataHashes[idx].recordType;
|
11099
|
-
}
|
11100
|
-
|
11101
|
-
// call new API. Returns storeKeys
|
11102
|
-
ret = store.loadRecords(recordType, dataHashes);
|
11103
|
-
|
11104
|
-
// map to Ember.Record instances
|
11105
|
-
len = ret.length;
|
11106
|
-
for(idx=0;idx<len;idx++) ret[idx] = store.materializeRecord(ret[idx]);
|
11107
|
-
|
11108
|
-
return ret ;
|
11109
|
-
};
|
11110
|
-
|
11111
|
-
/** @private
|
11112
|
-
|
11113
|
-
DEPRECATED
|
11114
|
-
|
11115
|
-
Finds a record with the passed guid on the default store. This is included
|
11116
|
-
only for compatibility. You should use the newer `find()` method defined on
|
11117
|
-
`Ember.Store` instead.
|
11118
|
-
|
11119
|
-
@param {String} guid the guid
|
11120
|
-
@param {Ember.Record} recordType expected record type
|
11121
|
-
@returns {Ember.Record} found record
|
11122
|
-
*/
|
11123
|
-
Ember.Store.find = function(guid, recordType) {
|
11124
|
-
return this._getDefaultStore().find(recordType, guid);
|
11125
|
-
};
|
11126
|
-
|
11127
|
-
/** @private
|
11128
|
-
|
11129
|
-
DEPRECATED
|
11130
|
-
|
11131
|
-
Passes through to `findAll` on default store. This is included only for
|
11132
|
-
compatibility. You should use the newer `findAll()` defined on `Ember.Store`
|
11133
|
-
instead.
|
11134
|
-
|
11135
|
-
@param {Hash} filter search parameters
|
11136
|
-
@param {Ember.Record} recordType type of record to find
|
11137
|
-
@returns {Ember.RecordArray} result set
|
11138
|
-
*/
|
11139
|
-
Ember.Store.findAll = function(filter, recordType) {
|
11140
|
-
return this._getDefaultStore().findAll(filter, recordType);
|
11141
|
-
};
|
11142
|
-
|
11143
|
-
|
11144
10997
|
})({});
|
11145
10998
|
|
11146
10999
|
|
11147
11000
|
(function(exports) {
|
11148
11001
|
// ==========================================================================
|
11149
|
-
// Project:
|
11002
|
+
// Project: Ember DataStore - JavaScript Application Framework
|
11150
11003
|
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
11151
11004
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
11152
11005
|
// License: Licensed under MIT license (see license.js)
|
11153
11006
|
// ==========================================================================
|
11154
|
-
/*globals sc_assert */
|
11155
|
-
|
11156
11007
|
var get = Ember.get, set = Ember.set;
|
11157
11008
|
|
11158
11009
|
var o_create = Ember.platform.create;
|
@@ -11170,7 +11021,7 @@ var o_create = Ember.platform.create;
|
|
11170
11021
|
working with the nested store, `destroy()` will dispose of it.
|
11171
11022
|
|
11172
11023
|
@extends Ember.Store
|
11173
|
-
@since
|
11024
|
+
@since Ember 1.0
|
11174
11025
|
*/
|
11175
11026
|
Ember.NestedStore = Ember.Store.extend(
|
11176
11027
|
/** @scope Ember.NestedStore.prototype */ {
|
@@ -11267,8 +11118,7 @@ Ember.NestedStore = Ember.Store.extend(
|
|
11267
11118
|
@returns {Ember.Record|Ember.RecordArray}
|
11268
11119
|
*/
|
11269
11120
|
find: function(query) {
|
11270
|
-
|
11271
|
-
!query || !(query instanceof Ember.Query) || get(query, 'location') === Ember.Query.LOCAL);
|
11121
|
+
ember_assert("Ember.Store#find() can only accept LOCAL queries in nested stores", !query || !(query instanceof Ember.Query) || get(query, 'location') === Ember.Query.LOCAL);
|
11272
11122
|
return this._super.apply(this, arguments);
|
11273
11123
|
},
|
11274
11124
|
|
@@ -11427,7 +11277,7 @@ Ember.NestedStore = Ember.Store.extend(
|
|
11427
11277
|
|
11428
11278
|
// already locked -- nothing to do
|
11429
11279
|
if (locks && locks[storeKey]) return this;
|
11430
|
-
|
11280
|
+
|
11431
11281
|
// create locks if needed
|
11432
11282
|
if (!locks) locks = this.locks = [];
|
11433
11283
|
|
@@ -11447,9 +11297,9 @@ Ember.NestedStore = Ember.Store.extend(
|
|
11447
11297
|
if (pstore && editState === Ember.Store.EDITABLE) {
|
11448
11298
|
|
11449
11299
|
pk = this.childRecords[storeKey];
|
11450
|
-
if (pk){
|
11451
|
-
// Since this is a nested record we have to actually walk up the
|
11452
|
-
// parent chain to get to the root parent and clone that hash. And
|
11300
|
+
if (pk) {
|
11301
|
+
// Since this is a nested record we have to actually walk up the
|
11302
|
+
// parent chain to get to the root parent and clone that hash. And
|
11453
11303
|
// then reconstruct the memory space linking.
|
11454
11304
|
this._lock(pk);
|
11455
11305
|
pr = this.parentRecords[pk];
|
@@ -11547,7 +11397,7 @@ Ember.NestedStore = Ember.Store.extend(
|
|
11547
11397
|
|
11548
11398
|
/** @private - bookkeeping for a single data hash. */
|
11549
11399
|
dataHashDidChange: function(storeKeys, rev, statusOnly, key) {
|
11550
|
-
|
11400
|
+
|
11551
11401
|
// update the revision for storeKey. Use generateStoreKey() because that
|
11552
11402
|
// gaurantees a universally (to this store hierarchy anyway) unique
|
11553
11403
|
// key value.
|
@@ -11756,7 +11606,7 @@ Ember.NestedStore = Ember.Store.extend(
|
|
11756
11606
|
throw Ember.Store.NESTED_STORE_UNSUPPORTED_ERROR;
|
11757
11607
|
}
|
11758
11608
|
|
11759
|
-
})
|
11609
|
+
});
|
11760
11610
|
|
11761
11611
|
|
11762
11612
|
})({});
|
@@ -11764,31 +11614,19 @@ Ember.NestedStore = Ember.Store.extend(
|
|
11764
11614
|
|
11765
11615
|
(function(exports) {
|
11766
11616
|
// ==========================================================================
|
11767
|
-
// Project:
|
11617
|
+
// Project: Ember DataStore
|
11768
11618
|
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
11769
11619
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
11770
11620
|
// License: Licensed under MIT license (see license.js)
|
11771
11621
|
// ==========================================================================
|
11772
|
-
|
11773
|
-
|
11774
|
-
|
11775
|
-
|
11776
|
-
|
11777
|
-
|
11778
|
-
|
11779
|
-
|
11780
11622
|
})({});
|
11781
11623
|
|
11782
11624
|
|
11783
11625
|
(function(exports) {
|
11784
11626
|
// ==========================================================================
|
11785
|
-
// Project:
|
11627
|
+
// Project: Ember DataStore
|
11786
11628
|
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
11787
11629
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
11788
11630
|
// License: Licensed under MIT license (see license.js)
|
11789
11631
|
// ==========================================================================
|
11790
|
-
|
11791
|
-
|
11792
|
-
|
11793
|
-
|
11794
11632
|
})({});
|