angularjs-rails-resource 0.2.5 → 1.0.0.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -2
- data/EXAMPLES.md +116 -116
- data/README.md +89 -38
- data/angularjs-rails-resource.js +157 -114
- data/angularjs-rails-resource.min.js +2 -2
- data/angularjs-rails-resource.zip +0 -0
- data/bower.json +1 -1
- data/lib/angularjs-rails-resource/version.rb +1 -1
- data/package.json +5 -5
- data/test/unit/angularjs/rails/resourceProviderSpec.js +12 -12
- data/test/unit/angularjs/rails/resourceSerializerSpec.js +1 -1
- data/test/unit/angularjs/rails/resourceSpec.js +99 -8
- data/test/unit/angularjs/rails/rootWrappingSpec.js +1 -1
- data/test/unit/angularjs/rails/serializationSpec.js +0 -16
- data/vendor/assets/javascripts/angularjs/rails/resource/resource.js +149 -97
- data/vendor/assets/javascripts/angularjs/rails/resource/serialization.js +6 -15
- data/vendor/assets/javascripts/angularjs/rails/resource/utils/url_builder.js +1 -1
- metadata +4 -4
@@ -207,7 +207,7 @@
|
|
207
207
|
* Specify a custom serializer to use for an attribute.
|
208
208
|
*
|
209
209
|
* @param attributeName {string} The name of the attribute
|
210
|
-
* @param serializer {string |
|
210
|
+
* @param serializer {string | function} A reference to the custom serializer to use for the attribute.
|
211
211
|
* @returns {Serializer} this for chaining support
|
212
212
|
*/
|
213
213
|
Serializer.prototype.serializeWith = function (attributeName, serializer) {
|
@@ -263,17 +263,8 @@
|
|
263
263
|
Serializer.prototype.getSerializedAttributeName = function (attributeName) {
|
264
264
|
var mappedName = this.serializeMappings[attributeName] || attributeName;
|
265
265
|
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
if(this.options.excludeByDefault) {
|
270
|
-
if(mappedNameExcluded && attributeNameExcluded) {
|
271
|
-
return undefined;
|
272
|
-
}
|
273
|
-
} else {
|
274
|
-
if (mappedNameExcluded || attributeNameExcluded) {
|
275
|
-
return undefined;
|
276
|
-
}
|
266
|
+
if (this.isExcludedFromSerialization(attributeName) || this.isExcludedFromSerialization(mappedName)) {
|
267
|
+
return undefined;
|
277
268
|
}
|
278
269
|
|
279
270
|
return this.underscore(mappedName);
|
@@ -338,9 +329,9 @@
|
|
338
329
|
|
339
330
|
// custom serializer takes precedence over resource serializer
|
340
331
|
if (serializer) {
|
341
|
-
return RailsResourceInjector.createService(serializer)
|
332
|
+
return RailsResourceInjector.createService(serializer)
|
342
333
|
} else if (resource) {
|
343
|
-
return resource.serializer;
|
334
|
+
return resource.config.serializer;
|
344
335
|
}
|
345
336
|
|
346
337
|
return undefined;
|
@@ -452,7 +443,7 @@
|
|
452
443
|
result = {};
|
453
444
|
|
454
445
|
if (Resource) {
|
455
|
-
result = new Resource();
|
446
|
+
result = new Resource.config.resourceConstructor();
|
456
447
|
}
|
457
448
|
|
458
449
|
angular.forEach(data, function (value, key) {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angularjs-rails-resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0.pre.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tommy Odom
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-10-15 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A small AngularJS add-on for integrating with Rails via JSON more easily.
|
15
15
|
email:
|
@@ -80,9 +80,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
80
80
|
version: '0'
|
81
81
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
|
-
- - '
|
83
|
+
- - '>'
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
85
|
+
version: 1.3.1
|
86
86
|
requirements: []
|
87
87
|
rubyforge_project:
|
88
88
|
rubygems_version: 2.0.6
|