material_raingular 0.5.2 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 122288a11835928f07aa26e50b0415186c052475
4
- data.tar.gz: eb5fed75c2a2c20d496f5fd072b7d66ea244da09
3
+ metadata.gz: 6506567f3b69bc2a7c04e433427709025d541cb7
4
+ data.tar.gz: 2d3b5e0b2b42ea631de6d44328709b15153ed112
5
5
  SHA512:
6
- metadata.gz: 0eeb25a76c993150bbb9b243340a29cf55ab15abbb3f12c554f445c9677282ea88deaac3ee36304dd06a10ddfec553438a0d35881170b04780343773a037cc43
7
- data.tar.gz: 21811f81a4e0802c4f2b2d7422c5a59fd2735a4525f431e034f16a2ae0b543c68bd428286e172acb2a88a2c135af725c846cefd936591f8a3fcb0a76d8af4d1c
6
+ metadata.gz: 0367a9a2ca9fdb7bd6e5255a06d43fb55938e43fee713ba721539e8f0e3ec41610e8a16b599cfa6c4cf564afd5f3fb2889d94c7de24d29631c49df7019c63ce0
7
+ data.tar.gz: fd955eeb2960a25d3b1e2bc28a560726268808e65dc8f1337c6d9143779434e8b581f03a3dd394465d7b32d0cfd768bada86ab965a84b52be387b6eb110a5ade
@@ -10,4 +10,4 @@ class ActiveRecord.$Collection extends Array
10
10
  for item in response.data
11
11
  @.push(ActiveRecord.$Resource.initialize(item,@options))
12
12
  @$resolved = true
13
- return response.data
13
+ return @
@@ -41,7 +41,8 @@ class ActiveRecord.Controller extends AngularServiceModel
41
41
  restful: ['new','create','index','edit','update','show','destroy']
42
42
  $buildUrls: ->
43
43
  @_urls ||= {}
44
- for item in [@parents].compact().flatten()
44
+ parents = if (typeof @parents == 'function') then @parents() else @parents
45
+ for item in [parents].compact().flatten()
45
46
  atom = if typeof item == 'string' then item else Object.keys(item)[0]
46
47
  foreignKey = item[atom]?.foreignKey || atom + '_id'
47
48
  @_urls[foreignKey] ||= {}
@@ -75,9 +76,9 @@ class ActiveRecord.Controller extends AngularServiceModel
75
76
  Desired Syntax
76
77
  class ActiveRecord.Project extends ActiveRecord.Base
77
78
  @register(angular.app)
78
- @parents: [{company: {shallow: true}},{person: {only: ['index']},'organization'] # Non-Shallow routes index,create,new Shallow routes update,edit,show,destroy
79
+ parents: [{company: {shallow: true}},{person: {only: ['index']},'organization'] # Non-Shallow routes index,create,new Shallow routes update,edit,show,destroy
79
80
  # Alternate function snytax:
80
- @parents: ->[{company: {shallow: true}},{person: {only: ['index']},'organization']
81
+ parents: ->[{company: {shallow: true}},{person: {only: ['index']},'organization']
81
82
 
82
83
  resulting functionality
83
84
  # New
@@ -119,8 +120,8 @@ resulting functionality
119
120
  Desired Syntax
120
121
  class ActiveRecord.Project extends ActiveRecord.Base
121
122
  @register(angular.app)
122
- @__url__: -> '/not_projects'
123
- @parents: [{company: {shallow: true}}]
123
+ __url__: -> '/not_projects'
124
+ parents: [{company: {shallow: true}}]
124
125
 
125
126
  resulting functionality
126
127
  # New
@@ -148,8 +149,8 @@ resulting functionality
148
149
  Desired Syntax
149
150
  class ActiveRecord.Project extends ActiveRecord.Base
150
151
  @register(angular.app)
151
- @__url__: -> '/not_projects'
152
- @parents: [{company: {shallow: true, url: '/not_companies/:id/something'}}]
152
+ __url__: -> '/not_projects'
153
+ parents: [{company: {shallow: true, url: '/not_companies/:id/something'}}]
153
154
 
154
155
  resulting functionality
155
156
  # New
@@ -32,12 +32,12 @@ class ActiveRecord.$Resource extends Module
32
32
  _defaultWrap: -> @_options.klass.underscore()
33
33
  _defaultPath: -> '/' + @_options.klass.tableize() + '/:id'
34
34
  $updateUrl: ->
35
- path = @_options.updateUrl || @_defaultPath()
35
+ path = @_options.update_url || @_defaultPath()
36
36
  path = path.replace(':id', @.id || '').replace(/\/$/,'')
37
37
  path += '.json' unless path.match(/\.json$/)
38
38
  path
39
39
  $destroyUrl: ->
40
- path = @_options.destroyUrl || @_defaultPath()
40
+ path = @_options.destroy_url || @_defaultPath()
41
41
  path = path.replace(':id', @.id)
42
42
  path += '.json' unless path.match(/\.json$/)
43
43
  path
@@ -1,3 +1,3 @@
1
1
  module MaterialRaingular
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: material_raingular
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Moody
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-15 00:00:00.000000000 Z
11
+ date: 2017-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler