material_raingular 0.2.6.3 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b86e94c024092a17319b356d01ca3f8dbcbd048
4
- data.tar.gz: 524eab01711341d1a5eebc8c0351fb8bf14a7aad
3
+ metadata.gz: d42e83b2720719a4987e85a0341b647f8367bf3b
4
+ data.tar.gz: 35eeb19e0c0144e59f1f77080ea083865902174b
5
5
  SHA512:
6
- metadata.gz: d7a782ae5ffb47e90af63caf39e7a4be6ccd03efcc18d32f6196f2e82678e65914d2cc955eb63b0fd89527b6a5df5cb11cd5b575fedb0cc5e3cc88b1a9de6181
7
- data.tar.gz: 67d8e9c79677b77d928faff1a4ce31302d70c030e02c2497d5f4e5839d612a85ac22e8d8fe1304cdcaff8f52e2dae6a30a88c1de6b9d28e73fb83152241d66ab
6
+ metadata.gz: 386470016b611811e5d550e5e65af1cbafbab6bf590b3c3e7c3e09d521e975fc1ea18bfa348aa57b54ba17f2cc79f3380175fe6f82f60491528697317b9c711c
7
+ data.tar.gz: ad4a55398c0a9ded90129e617126fa84533e643749836a0d24bed84cc34255757e03b4a19dfc87bd5b5a3a125e02ebc3cfd9c7327454836bcae763f577425fb6
@@ -24,11 +24,17 @@ class RailsUpdate
24
24
  atomName = if typeof @atomName == 'function' then @atomName(@scope) else @atomName
25
25
  @value = if @override then @scope.$eval(atomName) else value
26
26
  object = {id: @scope.$eval(@modelName).id}
27
- object[@railsName] = {}
27
+ if object.id
28
+ func = 'update'
29
+ object[@railsName] = {}
30
+ else
31
+ object[@railsName] = @scope.$eval(@modelName)
32
+ func = 'create'
28
33
  object[@railsName][atomName] = value
29
34
  unless @scope[@modelName].currently_updating.includes(atomName)
30
35
  @scope[@modelName].currently_updating.push(atomName)
31
- @factory.update object, (returnData) =>
36
+ @factory[func] object, (returnData) =>
37
+ @scope.$eval(@modelName).id = returnData.id if returnData.id
32
38
  @scope[@modelName].currently_updating.drop(atomName)
33
39
  unless @equiv(@ngModelCtrl.$viewValue,returnData[@atomName])
34
40
  @ngModelCtrl.$setModelValue = returnData[@atomName]
@@ -9,6 +9,8 @@ class @AdminRouteModel extends AngularRouteModel
9
9
  controller: 'Admin'
10
10
  personName: -> #'/person/name'
11
11
  controller: 'Admin'
12
+ time__cards: -> #'/time_cards'
13
+ return {}
12
14
  otherwise: ->
13
15
  redirectTo: '/'
14
16
  @register(angular.app)
@@ -19,12 +21,14 @@ class @AngularRouteModel extends AngularModel
19
21
  constructor: ($routeProvider,$locationProvider)->
20
22
  for key, val of @constructor.prototype
21
23
  continue if key in ['constructor', 'initialize']
24
+ obj = val()
25
+ obj.template ||= '' unless obj.templateUrl
22
26
  unless key in ['default','otherwise']
23
- route = key.replace('_','/:').tableize().singularize().replace('_','/')
27
+ route = key.replace(/\_/g,'/:').underscore().replace(/\_/g,'/').replace(/\/\:\/\:/g,'_')
24
28
  route = '/' + route unless route[0] is '/'
25
- $routeProvider.when(route,val())
29
+ $routeProvider.when(route,obj)
26
30
  else if key == 'default'
27
- $routeProvider.when('/',val())
31
+ $routeProvider.when('/',obj)
28
32
  else
29
- $routeProvider.otherwise(val())
33
+ $routeProvider.otherwise(obj)
30
34
  return $routeProvider
@@ -1,3 +1,3 @@
1
1
  module MaterialRaingular
2
- VERSION = "0.2.6.3"
2
+ VERSION = "0.2.7"
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.2.6.3
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Moody
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-01 00:00:00.000000000 Z
11
+ date: 2016-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler