ende 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (314) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-gemset +1 -0
  3. data/.ruby-version +1 -0
  4. data/build/build.css +112 -0
  5. data/build/build.js +36465 -0
  6. data/component.json +11 -15
  7. data/components/chaijs/assertion-error/1.0.0/component.json +18 -0
  8. data/components/chaijs/chai/1.9.1/.gitignore +22 -0
  9. data/components/chaijs/chai/1.9.1/.mailmap +1 -0
  10. data/components/chaijs/chai/1.9.1/.npmignore +14 -0
  11. data/components/chaijs/chai/1.9.1/.travis.yml +14 -0
  12. data/components/chaijs/chai/1.9.1/CONTRIBUTING.md +173 -0
  13. data/components/chaijs/chai/1.9.1/History.md +895 -0
  14. data/components/chaijs/chai/1.9.1/Makefile +93 -0
  15. data/components/chaijs/chai/1.9.1/README.md +99 -0
  16. data/components/chaijs/chai/1.9.1/ReleaseNotes.md +482 -0
  17. data/components/chaijs/chai/1.9.1/bower.json +27 -0
  18. data/components/chaijs/chai/1.9.1/chai.js +4782 -0
  19. data/components/chaijs/chai/1.9.1/component.json +50 -0
  20. data/components/chaijs/chai/1.9.1/karma.conf.js +28 -0
  21. data/components/chaijs/chai/1.9.1/karma.sauce.js +41 -0
  22. data/components/chaijs/chai/1.9.1/lib/chai/assertion.js +130 -0
  23. data/components/chaijs/chai/1.9.1/lib/chai/config.js +50 -0
  24. data/components/chaijs/chai/1.9.1/lib/chai/core/assertions.js +1314 -0
  25. data/components/chaijs/chai/1.9.1/lib/chai/interface/assert.js +1056 -0
  26. data/components/chaijs/chai/1.9.1/lib/chai/interface/expect.js +12 -0
  27. data/components/chaijs/chai/1.9.1/lib/chai/interface/should.js +78 -0
  28. data/components/chaijs/chai/1.9.1/lib/chai/utils/addChainableMethod.js +111 -0
  29. data/components/chaijs/chai/1.9.1/lib/chai/utils/addMethod.js +43 -0
  30. data/components/chaijs/chai/1.9.1/lib/chai/utils/addProperty.js +40 -0
  31. data/components/chaijs/chai/1.9.1/lib/chai/utils/flag.js +32 -0
  32. data/components/chaijs/chai/1.9.1/lib/chai/utils/getActual.js +18 -0
  33. data/components/chaijs/chai/1.9.1/lib/chai/utils/getEnumerableProperties.js +25 -0
  34. data/components/chaijs/chai/1.9.1/lib/chai/utils/getMessage.js +49 -0
  35. data/components/chaijs/chai/1.9.1/lib/chai/utils/getName.js +20 -0
  36. data/components/chaijs/chai/1.9.1/lib/chai/utils/getPathValue.js +102 -0
  37. data/components/chaijs/chai/1.9.1/lib/chai/utils/getProperties.js +35 -0
  38. data/components/chaijs/chai/1.9.1/lib/chai/utils/index.js +114 -0
  39. data/components/chaijs/chai/1.9.1/lib/chai/utils/objDisplay.js +49 -0
  40. data/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteChainableMethod.js +53 -0
  41. data/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteMethod.js +51 -0
  42. data/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteProperty.js +54 -0
  43. data/components/chaijs/chai/1.9.1/lib/chai/utils/test.js +26 -0
  44. data/components/chaijs/chai/1.9.1/lib/chai/utils/transferFlags.js +44 -0
  45. data/components/chaijs/chai/1.9.1/lib/chai/utils/type.js +45 -0
  46. data/components/chaijs/chai/1.9.1/lib/chai.js +87 -0
  47. data/components/chaijs/chai/1.9.1/package.json +42 -0
  48. data/components/chaijs/chai/1.9.1/sauce.browsers.js +128 -0
  49. data/components/chaijs/chai/1.9.1/support/sauce/sauce_connect_block.sh +7 -0
  50. data/components/chaijs/chai/1.9.1/support/sauce/sauce_connect_setup.sh +53 -0
  51. data/components/chaijs/chai/1.9.1/test/assert.js +638 -0
  52. data/components/chaijs/chai/1.9.1/test/bootstrap/index.js +22 -0
  53. data/components/chaijs/chai/1.9.1/test/bootstrap/karma.js +22 -0
  54. data/components/chaijs/chai/1.9.1/test/configuration.js +133 -0
  55. data/components/chaijs/chai/1.9.1/test/display/errors.js +14 -0
  56. data/components/chaijs/chai/1.9.1/test/display/message.js +47 -0
  57. data/components/chaijs/chai/1.9.1/test/expect.js +814 -0
  58. data/components/chaijs/chai/1.9.1/test/globalShould.js +15 -0
  59. data/components/chaijs/chai/1.9.1/test/plugins.js +24 -0
  60. data/components/chaijs/chai/1.9.1/test/should.js +744 -0
  61. data/components/chaijs/chai/1.9.1/test/utilities.js +309 -0
  62. data/components/chaijs/deep-eql/0.1.3/component.json +20 -0
  63. data/components/chaijs/deep-eql/0.1.3/lib/eql.js +257 -0
  64. data/components/chaijs/type-detect/0.1.1/component.json +18 -0
  65. data/components/chaijs/type-detect/0.1.1/lib/type.js +142 -0
  66. data/{vendor/components/indefinido-indemma/components/component-bind → components/component/bind/0.0.1}/component.json +1 -1
  67. data/{vendor/components/component-classes → components/component/classes/1.1.2}/component.json +1 -1
  68. data/components/component/classes/1.2.1/component.json +19 -0
  69. data/components/component/classes/1.2.1/index.js +184 -0
  70. data/{vendor/components/component-css → components/component/css/0.0.2}/component.json +2 -2
  71. data/{vendor/components/component-delegate → components/component/delegate/0.1.0}/component.json +2 -2
  72. data/components/component/dialog/0.2.0/component.json +35 -0
  73. data/{vendor/components/component-dialog → components/component/dialog/0.2.0}/index.js +74 -40
  74. data/components/component/dialog/0.2.0/template.html +9 -0
  75. data/{vendor/components/component-dom → components/component/dom/0.7.1}/component.json +6 -4
  76. data/{vendor/components/component-domify → components/component/domify/1.0.0}/component.json +6 -4
  77. data/components/component/domify/1.2.2/component.json +22 -0
  78. data/components/component/domify/1.2.2/index.js +87 -0
  79. data/{vendor/components/component-emitter → components/component/emitter/1.0.0}/component.json +1 -1
  80. data/{vendor/components/component-event → components/component/event/0.1.0}/component.json +3 -3
  81. data/components/component/event/0.1.0/index.js +40 -0
  82. data/components/component/event/0.1.3/component.json +13 -0
  83. data/{vendor/components/component-event → components/component/event/0.1.3}/index.js +3 -5
  84. data/{vendor/components/component-indexof → components/component/indexof/0.0.1}/component.json +1 -1
  85. data/{vendor/components/indefinido-indemma/components/component-jquery → components/component/jquery/1.9.1}/component.json +1 -1
  86. data/{vendor/components/component-matches-selector → components/component/matches-selector/0.1.2}/component.json +6 -4
  87. data/{vendor/components/component-overlay → components/component/overlay/0.1.1}/component.json +1 -1
  88. data/{vendor/components/component-query → components/component/query/0.0.1}/component.json +6 -4
  89. data/components/component/query/0.0.3/component.json +23 -0
  90. data/components/component/query/0.0.3/index.js +21 -0
  91. data/{vendor/components/component-querystring → components/component/querystring/1.3.0}/component.json +4 -3
  92. data/{vendor/components/component-querystring → components/component/querystring/1.3.0}/index.js +26 -2
  93. data/{vendor/components/component-sort → components/component/sort/0.0.3}/component.json +2 -2
  94. data/{vendor/components/component-trim → components/component/trim/0.0.1}/component.json +1 -1
  95. data/{vendor/components/indefinido-indemma/components/component-type → components/component/type/1.0.0}/component.json +4 -2
  96. data/{vendor/components/component-value → components/component/value/1.1.0}/component.json +6 -4
  97. data/{vendor/components/components-modernizr → components/components/modernizr/2.6.2}/component.json +2 -3
  98. data/{vendor/components/indefinido-indemma/components/indefinido-advisable → components/indefinido/advisable/master}/component.json +2 -2
  99. data/components/indefinido/indemma/master/History.md +0 -0
  100. data/components/indefinido/indemma/master/build/build.js +26288 -0
  101. data/components/indefinido/indemma/master/build/development.js +22200 -0
  102. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/build/release.js +264 -273
  103. data/components/indefinido/indemma/master/build/test.js +22200 -0
  104. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/component.json +6 -6
  105. data/components/indefinido/indemma/master/components/chaijs-assertion-error/index.js +110 -0
  106. data/components/indefinido/indemma/master/components/chaijs-chai/index.js +1 -0
  107. data/components/indefinido/indemma/master/components/chaijs-chai/lib/chai/utils/inspect.js +320 -0
  108. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/associable.js +2 -14
  109. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/rest.js +2 -7
  110. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/restfulable.js +9 -33
  111. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/scopable.js +45 -16
  112. data/components/indefinido/indemma/master/lib/record/validatable.js +1100 -0
  113. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/associable_spec.js +2 -3
  114. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/scopable_spec.js +53 -83
  115. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/cpf_spec.js +6 -5
  116. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/associable.coffee +0 -6
  117. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/persistable.coffee +0 -2
  118. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/queryable.coffee +2 -1
  119. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/resource.coffee +2 -3
  120. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/rest.coffee +1 -7
  121. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/restfulable.coffee +8 -34
  122. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/scopable.coffee +31 -32
  123. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validatable.coffee +1 -12
  124. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/associable_spec.coffee +2 -3
  125. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/scopable_spec.coffee +43 -76
  126. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/cpf_spec.coffee +4 -3
  127. data/{vendor/components/mikeric-rivets → components/mikeric/rivets/v0.5.12}/component.json +2 -2
  128. data/{vendor/components/paulmillr-es6-shim → components/paulmillr/es6-shim/0.10.1}/component.json +11 -4
  129. data/components/paulmillr/es6-shim/0.10.1/es6-shim.js +1833 -0
  130. data/{vendor/components/pluma-assimilate → components/pluma/assimilate/0.3.0}/component.json +3 -3
  131. data/{vendor/components/segmentio-extend → components/segmentio/extend/1.0.0}/component.json +3 -3
  132. data/lib/assets/javascripts/aura/extensions/models.js.coffee.erb +14 -14
  133. data/lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee +1 -1
  134. data/lib/assets/javascripts/aura/extensions/rivets.js.coffee +3 -3
  135. data/lib/assets/javascripts/aura/extensions/stamps/stampit.js +568 -242
  136. data/lib/assets/javascripts/aura/extensions/widget/#composable.js.coffee# +135 -0
  137. data/lib/assets/javascripts/aura/extensions/widget/composable.js.coffee +2 -2
  138. data/lib/assets/javascripts/config/load_components.js.coffee +10 -10
  139. data/lib/assets/javascripts/ende.js.coffee +21 -18
  140. data/lib/assets/javascripts/widgets/support/adapters/olark.js +1 -4
  141. data/lib/assets/javascripts/widgets/viewer/main.js.coffee +8 -4
  142. data/lib/assets/javascripts/widgets/viewer/plugins/scopable.js.coffee +6 -7
  143. data/lib/ende/version.rb +1 -1
  144. data/vendor/assets/components/build.css +4 -3
  145. data/vendor/assets/components/ende_build.js +29772 -21943
  146. metadata +284 -217
  147. data/vendor/components/KapIT-observe-utils/component.json +0 -16
  148. data/vendor/components/KapIT-observe-utils/lib/observe-utils.js +0 -780
  149. data/vendor/components/component-dialog/component.json +0 -23
  150. data/vendor/components/component-dialog/template.js +0 -1
  151. data/vendor/components/indefinido-indemma/build/development.js +0 -343
  152. data/vendor/components/indefinido-indemma/build/test.js +0 -343
  153. data/vendor/components/indefinido-indemma/lib/record/validatable.js +0 -224
  154. data/vendor/components/indefinido-observable/component.json +0 -24
  155. data/vendor/components/indefinido-observable/index.js +0 -1
  156. data/vendor/components/indefinido-observable/lib/adapters/rivets.js +0 -28
  157. data/vendor/components/indefinido-observable/lib/observable.js +0 -390
  158. data/vendor/components/indefinido-observable/vendor/shims/accessors-legacy.js +0 -92
  159. data/vendor/components/indefinido-observable/vendor/shims/accessors.js +0 -248
  160. data/vendor/components/indefinido-observable/vendor/shims/array.indexOf.js +0 -8
  161. data/vendor/components/indefinido-observable/vendor/shims/object.create.js +0 -77
  162. data/vendor/components/paulmillr-es6-shim/es6-shim.js +0 -996
  163. /data/{vendor/components/indefinido-indemma/components/chaijs-assertion-error → components/chaijs/assertion-error/1.0.0}/index.js +0 -0
  164. /data/{vendor/components/indefinido-indemma/components/chaijs-chai → components/chaijs/chai/1.9.1}/index.js +0 -0
  165. /data/{vendor/components/indefinido-indemma/components/chaijs-chai → components/chaijs/chai/1.9.1}/lib/chai/utils/inspect.js +0 -0
  166. /data/{vendor/components/indefinido-indemma/History.md → components/chaijs/chai/1.9.1/test/auth/.gitkeep} +0 -0
  167. /data/{vendor/components/component-bind → components/component/bind/0.0.1}/index.js +0 -0
  168. /data/{vendor/components/component-classes → components/component/classes/1.1.2}/index.js +0 -0
  169. /data/{vendor/components/component-css → components/component/css/0.0.2}/index.js +0 -0
  170. /data/{vendor/components/component-delegate → components/component/delegate/0.1.0}/index.js +0 -0
  171. /data/{vendor/components/component-dialog → components/component/dialog/0.2.0}/dialog.css +0 -0
  172. /data/{vendor/components/component-dom → components/component/dom/0.7.1}/index.js +0 -0
  173. /data/{vendor/components/component-domify → components/component/domify/1.0.0}/index.js +0 -0
  174. /data/{vendor/components/component-emitter → components/component/emitter/1.0.0}/index.js +0 -0
  175. /data/{vendor/components/component-indexof → components/component/indexof/0.0.1}/index.js +0 -0
  176. /data/{vendor/components/component-jquery → components/component/jquery/1.9.1}/index.js +0 -0
  177. /data/{vendor/components/component-matches-selector → components/component/matches-selector/0.1.2}/index.js +0 -0
  178. /data/{vendor/components/component-overlay → components/component/overlay/0.1.1}/index.js +0 -0
  179. /data/{vendor/components/component-overlay → components/component/overlay/0.1.1}/overlay.css +0 -0
  180. /data/{vendor/components/component-overlay → components/component/overlay/0.1.1}/template.js +0 -0
  181. /data/{vendor/components/component-query → components/component/query/0.0.1}/index.js +0 -0
  182. /data/{vendor/components/component-sort → components/component/sort/0.0.3}/index.js +0 -0
  183. /data/{vendor/components/component-trim → components/component/trim/0.0.1}/index.js +0 -0
  184. /data/{vendor/components/component-type → components/component/type/1.0.0}/index.js +0 -0
  185. /data/{vendor/components/component-value → components/component/value/1.1.0}/index.js +0 -0
  186. /data/{vendor/components/components-modernizr → components/components/modernizr/2.6.2}/modernizr.js +0 -0
  187. /data/{vendor/components/indefinido-advisable → components/indefinido/advisable/master}/index.js +0 -0
  188. /data/{vendor/components/indefinido-advisable → components/indefinido/advisable/master}/lib/advisable.js +0 -0
  189. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/.gitignore +0 -0
  190. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/.ruby-gemset +0 -0
  191. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/.ruby-version +0 -0
  192. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/Gemfile +0 -0
  193. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/Guardfile +0 -0
  194. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/Readme.md +0 -0
  195. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-assertion-error/component.json +0 -0
  196. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/component.json +0 -0
  197. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/assertion.js +0 -0
  198. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/core/assertions.js +0 -0
  199. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/interface/assert.js +0 -0
  200. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/interface/expect.js +0 -0
  201. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/interface/should.js +0 -0
  202. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/addChainableMethod.js +0 -0
  203. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/addMethod.js +0 -0
  204. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/addProperty.js +0 -0
  205. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/eql.js +0 -0
  206. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/flag.js +0 -0
  207. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getActual.js +0 -0
  208. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getEnumerableProperties.js +0 -0
  209. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getMessage.js +0 -0
  210. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getName.js +0 -0
  211. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getPathValue.js +0 -0
  212. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getProperties.js +0 -0
  213. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/index.js +0 -0
  214. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/objDisplay.js +0 -0
  215. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/overwriteMethod.js +0 -0
  216. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/overwriteProperty.js +0 -0
  217. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/test.js +0 -0
  218. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/transferFlags.js +0 -0
  219. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/type.js +0 -0
  220. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai.js +0 -0
  221. /data/{vendor → components/indefinido/indemma/master}/components/component-bind/component.json +0 -0
  222. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/component-bind/index.js +0 -0
  223. /data/{vendor → components/indefinido/indemma/master}/components/component-jquery/component.json +0 -0
  224. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/component-jquery/index.js +0 -0
  225. /data/{vendor → components/indefinido/indemma/master}/components/component-type/component.json +0 -0
  226. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/component-type/index.js +0 -0
  227. /data/{vendor → components/indefinido/indemma/master}/components/indefinido-advisable/component.json +0 -0
  228. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-advisable/index.js +0 -0
  229. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-advisable/lib/advisable.js +0 -0
  230. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/component.json +0 -0
  231. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/components/cjohansen-sinon/sinon.js +0 -0
  232. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/index.js +0 -0
  233. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/lib/adapters/rivets.js +0 -0
  234. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/lib/observable.js +0 -0
  235. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/vendor/shims/accessors-legacy.js +0 -0
  236. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/vendor/shims/accessors.js +0 -0
  237. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/vendor/shims/array.indexOf.js +0 -0
  238. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/vendor/shims/object.create.js +0 -0
  239. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/kapit-observe-utils/component.json +0 -0
  240. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/paulmillr-es6-shim/component.json +0 -0
  241. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/paulmillr-es6-shim/es6-shim.js +0 -0
  242. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/pluma-assimilate/component.json +0 -0
  243. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/pluma-assimilate/dist/assimilate.js +0 -0
  244. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/index.js +0 -0
  245. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/karma.conf.js +0 -0
  246. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/extensions/rivets.js +0 -0
  247. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/errors.js +0 -0
  248. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/maid.js +0 -0
  249. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/persistable.js +0 -0
  250. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/queryable.js +0 -0
  251. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/resource.js +0 -0
  252. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/storable.js +0 -0
  253. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/translationable.js +0 -0
  254. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/associated.js +0 -0
  255. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/confirmation.js +0 -0
  256. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/cpf.js +0 -0
  257. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/presence.js +0 -0
  258. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/remote.js +0 -0
  259. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/type.js +0 -0
  260. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/validatorable.js +0 -0
  261. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record.js +0 -0
  262. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/package.json +0 -0
  263. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/persistable_spec.js +0 -0
  264. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/queryable_spec.js +0 -0
  265. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/resource_spec.js +0 -0
  266. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/rest_spec.js +0 -0
  267. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/restfulable_spec.js +0 -0
  268. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/storable_spec.js +0 -0
  269. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/translationable.js +0 -0
  270. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validatable_spec.js +0 -0
  271. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/associated_spec.js +0 -0
  272. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/confirmation_spec.js +0 -0
  273. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/presence_spec.js +0 -0
  274. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/remote_spec.js +0 -0
  275. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/type_spec.js +0 -0
  276. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record_spec.js +0 -0
  277. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/spec_helper.js +0 -0
  278. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/support/value_objects/phone.js +0 -0
  279. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/extensions/rivets.coffee +0 -0
  280. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/errors.coffee +0 -0
  281. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/maid.coffee +0 -0
  282. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/storable.coffee +0 -0
  283. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/translationable.coffee +0 -0
  284. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/associated.coffee +0 -0
  285. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/confirmation.coffee +0 -0
  286. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/cpf.coffee +0 -0
  287. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/presence.coffee +0 -0
  288. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/remote.coffee +0 -0
  289. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/type.coffee +0 -0
  290. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/validatorable.coffee +0 -0
  291. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record.coffee +0 -0
  292. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/persistable_spec.coffee +0 -0
  293. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/queryable_spec.coffee +0 -0
  294. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/resource_spec.coffee +0 -0
  295. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/rest_spec.coffee +0 -0
  296. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/restfulable_spec.coffee +0 -0
  297. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/storable_spec.coffee +0 -0
  298. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/translationable.coffee +0 -0
  299. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validatable_spec.coffee +0 -0
  300. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/associated_spec.coffee +0 -0
  301. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/confirmation_spec.coffee +0 -0
  302. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/presence_spec.coffee +0 -0
  303. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/remote_spec.coffee +0 -0
  304. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/type_spec.coffee +0 -0
  305. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record_spec.coffee +0 -0
  306. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/spec_helper.coffee +0 -0
  307. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/support/value_objects/phone.coffee +0 -0
  308. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/vendor/object/mixin.js +0 -0
  309. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/vendor/owl/pluralize.js +0 -0
  310. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/vendor/sinon.js +0 -0
  311. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/vendor/stampit.js +0 -0
  312. /data/{vendor/components/mikeric-rivets → components/mikeric/rivets/v0.5.12}/dist/rivets.js +0 -0
  313. /data/{vendor/components/pluma-assimilate → components/pluma/assimilate/0.3.0}/dist/assimilate.js +0 -0
  314. /data/{vendor/components/segmentio-extend → components/segmentio/extend/1.0.0}/index.js +0 -0
@@ -124,12 +124,11 @@ describe('model', function() {
124
124
  return association = person().friends;
125
125
  });
126
126
  it('should have query methods', function() {
127
- association.should.have.property('has_many');
128
- association.should.have.property('find');
127
+ association.should.have.property('all');
129
128
  association.should.have.property('each');
130
129
  return association.should.have.property('reload');
131
130
  });
132
- return describe('#every', function() {
131
+ return describe('#all', function() {
133
132
  return it('should auto observe nested associations attributes');
134
133
  });
135
134
  });
@@ -20,8 +20,11 @@ describe('scopable', function() {
20
20
  });
21
21
  return describe('model', function() {
22
22
  return describe('#(options)', function() {
23
+ var person;
24
+
25
+ person = null;
23
26
  beforeEach(function() {
24
- return this.person = model.call({
27
+ return person = model.call({
25
28
  $hetero: true,
26
29
  $by_type: [],
27
30
  $by_name: String,
@@ -29,14 +32,14 @@ describe('scopable', function() {
29
32
  });
30
33
  });
31
34
  it('should add scope methods to model', function() {
32
- return this.person.none.should.be["function"];
35
+ return person.none.should.be["function"];
33
36
  });
34
37
  it('should generate scope methods based on model definition', function() {
35
- return this.person.hetero.should.be["function"];
38
+ return person.hetero.should.be["function"];
36
39
  });
37
40
  describe('#none', function() {
38
41
  return it('should return empty response on fetch calls', function(done) {
39
- return this.person.none().fetch(null, function(people) {
42
+ return person.none().fetch(null, function(people) {
40
43
  people.length.should.be.empty;
41
44
  return done();
42
45
  });
@@ -45,22 +48,28 @@ describe('scopable', function() {
45
48
  describe('scope', function() {
46
49
  return describe('#(name, type)', function() {
47
50
  return it('should add scope methods to model', function() {
48
- this.person.scope('bissexual', Boolean);
49
- return this.person.bissexual.should.be["function"];
51
+ person.scope('bissexual', Boolean);
52
+ return person.bissexual.should.be["function"];
50
53
  });
51
54
  });
52
55
  });
53
56
  return describe('#{generated_scope}', function() {
57
+ var deferred;
58
+
59
+ deferred = null;
54
60
  beforeEach(function() {
55
- this.request = jQuery.Deferred();
56
- sinon.stub(jQuery, "ajax").returns(this.request);
57
- return this.person.scope.clear();
61
+ deferred = jQuery.Deferred();
62
+ sinon.stub(jQuery, "ajax").returns(deferred);
63
+ return person.scope.clear();
58
64
  });
59
65
  afterEach(function() {
60
66
  return jQuery.ajax.restore();
61
67
  });
62
- describe('#every', function() {
63
- return it('should fetch models from the server', function(done) {
68
+ describe('#all', function() {
69
+ var promises;
70
+
71
+ deferred = promises = person = null;
72
+ return it('should return models when promise is resolved', function(done) {
64
73
  var fetched;
65
74
 
66
75
  fetched = function(people) {
@@ -68,8 +77,8 @@ describe('scopable', function() {
68
77
  people[0].name.should.be.string;
69
78
  return done();
70
79
  };
71
- this.person.every(fetched);
72
- this.request.resolveWith(this.person, [
80
+ person.every(fetched);
81
+ deferred.resolveWith(person, [
73
82
  [
74
83
  {
75
84
  name: 'Arthur'
@@ -83,22 +92,22 @@ describe('scopable', function() {
83
92
  });
84
93
  describe('when string', function() {
85
94
  it('should acumulate data in scope object', function() {
86
- this.person.by_name();
87
- return this.person.scope.data.by_name.should.be.a('string');
95
+ person.by_name();
96
+ return person.scope.data.by_name.should.be.a('string');
88
97
  });
89
98
  return it('should override data throught parameters', function() {
90
- this.person.by_name('Ford');
91
- return this.person.scope.data.by_name.should.be.eq('Ford');
99
+ person.by_name('Ford');
100
+ return person.scope.data.by_name.should.be.eq('Ford');
92
101
  });
93
102
  });
94
103
  describe('when array', function() {
95
104
  it('should acumulate data in scope object', function() {
96
- this.person.by_type();
97
- return this.person.scope.data.by_type.should.be.a('array');
105
+ person.by_type();
106
+ return person.scope.data.by_type.should.be.a('array');
98
107
  });
99
108
  it('should override data throught parameters', function() {
100
- this.person.by_type(1, 2, 3);
101
- return this.person.scope.data.by_type.should.contain(1, 2, 3);
109
+ person.by_type(1, 2, 3);
110
+ return person.scope.data.by_type.should.contain(1, 2, 3);
102
111
  });
103
112
  it('should use default value');
104
113
  it('should allow scope chaining');
@@ -106,42 +115,45 @@ describe('scopable', function() {
106
115
  it('should build correct url', function() {
107
116
  var settings;
108
117
 
109
- this.person.by_type(1, 3, 4).fetch();
118
+ person.by_type(1, 3, 4).fetch();
110
119
  settings = jQuery.ajax.firstCall.args[0];
111
120
  settings.should.have.property('data');
112
121
  settings.data.should.have.property('by_type');
113
122
  return settings.data.by_type.should.include(1, 3, 4);
114
123
  });
115
124
  return it('should make call', function() {
116
- this.person.by_type(1, 3, 4).fetch();
125
+ person.by_type(1, 3, 4).fetch();
117
126
  return jQuery.ajax.callCount.should.be.eq(1);
118
127
  });
119
128
  });
120
129
  });
121
130
  describe('when boolean', function() {
122
131
  it('should acumulate data in scope object', function() {
123
- this.person.hetero();
124
- return this.person.scope.data.hetero.should.be.eq(true);
132
+ person.hetero();
133
+ return person.scope.data.hetero.should.be.eq(true);
125
134
  });
126
135
  it('should override data throught parameters', function() {
127
- this.person.hetero(false);
128
- return this.person.scope.data.hetero.should.be.eq(false);
136
+ person.hetero(false);
137
+ return person.scope.data.hetero.should.be.eq(false);
129
138
  });
130
139
  it('should allow scope chaining');
131
140
  return it('should make ajax call', function() {
132
- this.person.hetero().fetch();
141
+ person.hetero().fetch();
133
142
  return jQuery.ajax.callCount.should.be.eq(1);
134
143
  });
135
144
  });
136
145
  return describe('#{generated_association}', function() {
137
146
  describe('of type belongs_to', function() {
147
+ var towel;
148
+
149
+ towel = null;
138
150
  beforeEach(function() {
139
- this.person = model.call({
151
+ person = model.call({
140
152
  $hetero: true,
141
153
  $by_type: [],
142
154
  resource: 'person'
143
155
  });
144
- return this.towel = model.call({
156
+ return towel = model.call({
145
157
  resource: 'towel',
146
158
  material: 'cotton',
147
159
  belongs_to: 'person'
@@ -151,7 +163,7 @@ describe('scopable', function() {
151
163
  return it('can be called on association', function() {
152
164
  var soft_towel;
153
165
 
154
- soft_towel = this.towel({
166
+ soft_towel = towel({
155
167
  material: 'silicon microfiber'
156
168
  });
157
169
  soft_towel.build_person();
@@ -160,79 +172,37 @@ describe('scopable', function() {
160
172
  });
161
173
  });
162
174
  return describe('of type has_many', function() {
175
+ var arthur, towel;
176
+
177
+ arthur = towel = null;
163
178
  beforeEach(function() {
164
- this.person = model.call({
179
+ person = model.call({
165
180
  $hetero: true,
166
181
  $by_type: [],
167
182
  resource: 'person',
168
183
  has_many: 'towels'
169
184
  });
170
- this.towel = model.call({
185
+ towel = model.call({
171
186
  $by_material: [],
172
187
  resource: 'towel',
173
188
  material: 'cotton',
174
189
  belongs_to: 'person'
175
190
  });
176
- this.arthur = this.person({
191
+ return arthur = person({
177
192
  name: 'Arthur'
178
193
  });
179
- return this.person.scope.clear();
180
194
  });
181
195
  return describe('#{generated_scope}', function() {
182
196
  it('can be called on association', function() {
183
- return expect(this.arthur.towels).to.respondTo('by_material');
197
+ return expect(arthur.towels).to.respondTo('by_material');
184
198
  });
185
- it('should be serializable into paramenters', function() {
199
+ return it('should be serializable into paramenters', function() {
186
200
  var query_string;
187
201
 
188
- this.arthur.towels.by_material('cotton', 'microfiber');
189
- query_string = decodeURIComponent(jQuery.param(this.arthur.towels.scope.data));
202
+ arthur.towels.by_material('cotton', 'microfiber');
203
+ query_string = decodeURIComponent(jQuery.param(arthur.towels.scope.data));
190
204
  return query_string.should.be.eq('by_material[]=cotton&by_material[]=microfiber');
191
205
  });
192
- return describe('#every', function() {
193
- it('should empty association when no models are returned', function(done) {
194
- var fetched,
195
- _this = this;
196
-
197
- fetched = function(towels) {
198
- towels.should.be.array;
199
- towels.should.be.empty;
200
- _this.arthur.towels.should.have.length(0);
201
- this.should.have.length(0) ;
202
- return done();
203
- };
204
- this.arthur.towels.every(fetched);
205
- this.request.resolveWith(this.arthur.towels, [[]]);
206
- return jQuery.ajax.callCount.should.be.eq(1);
207
- });
208
- return it('should update resources when already exists in association', function(done) {
209
- var aditions, fetched,
210
- _this = this;
211
-
212
- aditions = this.arthur.towels.add({
213
- _id: 1,
214
- material: 'colan'
215
- });
216
- fetched = function(towels) {
217
- towels.should.be.array;
218
- towels.should.have.length(1);
219
- towels[0].material.should.be.eq('cotton');
220
- aditions[0].material.should.be.eq('cotton');
221
- _this.arthur.towels[0].material.should.be.eq('cotton');
222
- return done();
223
- };
224
- this.arthur.towels.every(fetched);
225
- this.request.resolveWith(this.arthur.towels, [
226
- [
227
- {
228
- _id: 1,
229
- material: 'cotton'
230
- }
231
- ]
232
- ]);
233
- return jQuery.ajax.callCount.should.be.eq(1);
234
- });
235
- });
236
206
  });
237
207
  });
238
208
  });
@@ -6,25 +6,26 @@ require('indemma/lib/record/validatable');
6
6
 
7
7
  describe('model #() validates_cpf_format', function() {
8
8
  return describe('basic usage', function() {
9
- var model;
9
+ var model, person;
10
10
 
11
11
  model = root.model;
12
+ person = null;
12
13
  beforeEach(function() {
13
- return this.person = model.call({
14
+ return person = model.call({
14
15
  resource: 'person',
15
16
  cpf: String,
16
17
  validates_cpf_format: 'cpf'
17
18
  });
18
19
  });
19
20
  afterEach(function() {
20
- return this.person.validators.length = 0;
21
+ return person != null ? person.validators.length = 0 : void 0;
21
22
  });
22
23
  return describe('#validate', function() {
23
24
  return it('should add error to record when fields is in invalid format', function() {
24
25
  var arthur;
25
26
 
26
- arthur = this.person({
27
- cpf: '871.95FRANGO-00'
27
+ arthur = person({
28
+ cpf: '871.943.417-00'
28
29
  });
29
30
  arthur.valid;
30
31
  return arthur.errors.messages.should.have.deep.property('cpf', "O campo cpf não está válido.");
@@ -32,16 +32,10 @@ plural = # has_many ## TODO embeds_many
32
32
  push : ->
33
33
  console.warn "#{@resource}.push is deprecated and will be removed, please use add instead"
34
34
  Array.prototype.push.apply @, arguments
35
- arguments[0]
36
35
 
37
36
  length : 0
38
37
  json : (methods, omissions) -> record.json(methods, omissions) for record in @
39
38
 
40
- find : (id) -> return resource for resource in @ when resource._id is id
41
-
42
- # TODO better support searching
43
- filter : Array.prototype.filter || _?.filter
44
-
45
39
 
46
40
  singular = # belongs_to, has_one ## TODO embeds_one, embedded_in
47
41
  # @ = record
@@ -12,8 +12,6 @@ handlers =
12
12
 
13
13
  persistable =
14
14
  record:
15
- # TODO better caching check after resource initialization
16
- # TODO think how to retrieve already stored resources
17
15
  after_initialize: ->
18
16
  if @_id
19
17
  # TODO remove global model usage
@@ -9,7 +9,8 @@ queryable =
9
9
  find: (key) ->
10
10
  throw new TypeError "InvalidFind: resource.find was called with a falsey value" unless key
11
11
  @storage.store key
12
- every: -> @storage.values()
12
+ every: ->
13
+ @storage.values()
13
14
  where: ->
14
15
  throw new Error 'queryable.where: Not implemented yet'
15
16
 
@@ -25,7 +25,6 @@ resource = stampit
25
25
  @
26
26
 
27
27
  # TODO Think of a better name, and move to a composable stampit item
28
- # TODO Externalize route generatio so we can reuse in other files
29
28
  descriptors =
30
29
  route:
31
30
  get: ->
@@ -34,9 +33,9 @@ descriptors =
34
33
 
35
34
  route = '/'
36
35
  route += "#{@parent.route}/#{@parent._id}/" if @parent?
37
- route += @resource.scope + '/' if @resource.scope?
36
+ route += @resource.scope + '/' if @resource.scope?
38
37
 
39
- route += if @resource.singular then @resource.name else model.pluralize @resource.name
38
+ route += if @resource.singular then @resource.name else model.pluralize @resource.name
40
39
 
41
40
  @route = route
42
41
 
@@ -7,9 +7,7 @@ module.exports =
7
7
  post : (data) -> request.call @, 'post' , @route, data
8
8
  delete: (data) -> request.call @, 'delete', (if @_id then "#{@route}/#{@_id}" else @route), data
9
9
 
10
-
11
- # TODO move to serialization module
12
- data_for = (data) ->
10
+ request = (method, url, data) ->
13
11
  param_name = @resource.param_name || @resource.toString()
14
12
 
15
13
  # TODO optmize this serialization lookup
@@ -21,10 +19,6 @@ data_for = (data) ->
21
19
  delete data[param_name]['id']
22
20
  delete data[param_name]['_id']
23
21
 
24
- data
25
-
26
- request = (method, url, data) ->
27
- data = data_for.call @, data
28
22
 
29
23
  $.ajax
30
24
  url : url
@@ -63,13 +63,7 @@ restful =
63
63
  get: (action, data = {}) ->
64
64
  # TODO better way to override route
65
65
  old_route = @route
66
-
67
- # TODO extract route generation concern
68
- default_route = ''
69
- default_route += @resource.scope + '/' if @resource.scope?
70
- default_route += if @resource.singular then @resource.name else model.pluralize @resource.name
71
-
72
- # TODO think why this code is here
66
+ default_route = "/#{model.pluralize @resource.name}"
73
67
  @route = default_route unless default_route == @route
74
68
 
75
69
  if action
@@ -184,19 +178,6 @@ restful =
184
178
  @[association_name] = @["build_#{association_name}"] association_attributes if association_attributes
185
179
 
186
180
 
187
- # Nested attributes
188
- # TODO implement setter on belongs_to association and move this
189
- # code there
190
- for association_name in model[@resource.toString()].belongs_to
191
- association_attributes = attributes[association_name]?.json?() ? attributes[association_name]
192
-
193
- # TODO copy attributes object and don't change it inside the
194
- # assignment method
195
- delete attributes[association_name]
196
- delete attributes[association_name + "_attributes"]
197
- @[association_name] = @["build_#{association_name}"] association_attributes if association_attributes
198
-
199
-
200
181
  # Assign remaining attributes
201
182
  # TODO see if it is a best practice not overriding unchanged attributes
202
183
  # TODO rename attributes for properties
@@ -342,7 +323,7 @@ restful =
342
323
  # TODO move this to serializable module
343
324
  # TODO figure out why sometimes is rendering a circular referenced json
344
325
  # TODO rename to toJSON
345
- json: (options = {}) ->
326
+ json: (methods = {}) ->
346
327
  json = {}
347
328
 
348
329
  definition = model[@resource.toString()]
@@ -375,7 +356,7 @@ restful =
375
356
 
376
357
  # TODO move nested attributes to model definition and
377
358
  # implement toJSON there
378
- json["#{name}_attributes"] = value.json options[name]
359
+ json["#{name}_attributes"] = value.json methods[name]
379
360
 
380
361
  # Serialize complex type values
381
362
  else if value.toJSON? || value.json?
@@ -385,9 +366,9 @@ restful =
385
366
 
386
367
  # TODO rename json to toJSON
387
368
  if value.json?
388
- json[name] = value.json options[name]
369
+ json[name] = value.json methods[name]
389
370
  else
390
- json[name] = value.toJSON options[name]
371
+ json[name] = value.toJSON methods[name]
391
372
 
392
373
  # It is a complex type value without serializtion support so
393
374
  # we just ignore it
@@ -400,16 +381,9 @@ restful =
400
381
  # Serialize primitive type values
401
382
  json[name] = value
402
383
 
403
- # Remove observable options and dom node properties
384
+ # Remove observable methods and dom node properties
404
385
  json = observable.unobserve json
405
386
 
406
- for name, value of options.methods ? {}
407
- method = @[name]
408
- if typeof method == 'function'
409
- json[name] = method()
410
- else
411
- json[name] = method
412
-
413
387
  # TODO Store reserved words in a array
414
388
  # TODO Use _.omit function
415
389
  # TODO Use object.defineProperty to not need to delete this properties
@@ -442,7 +416,7 @@ restful =
442
416
  json
443
417
 
444
418
 
445
- # TODO pt udeprecation warning on json method
419
+ # TODO put deprecation warning on json method
446
420
  # TODO rename json method to toJSON
447
421
  restful.toJSON = restful.json
448
422
 
@@ -470,4 +444,4 @@ model.associable && model.associable.mix (singular_association, plural_associat
470
444
 
471
445
  plural_association.post = ->
472
446
  @route ||= "#{@parent.route}/#{@parent._id}/#{model.pluralize @resource.name}" if @parent?
473
- rest.post.apply @, arguments
447
+ rest.post.apply @, arguments
@@ -108,7 +108,6 @@ scopable =
108
108
  @scope.fetch.call @, data, done, fail
109
109
 
110
110
  # TODO optmize this iterations or add support for stampit on associable and merge factories
111
- # TODO rename this method to forward extensions to association, and store extensions on has_many definitions
112
111
  # @ = record instance
113
112
  forward_scopes_to_associations: ->
114
113
  factory = model[@resource.name]
@@ -130,24 +129,34 @@ scopable =
130
129
  for scope in associated_factory.scope.declared
131
130
  association.scope scope, associated_factory["$#{scope}"]
132
131
 
132
+ for associated_resource in factory.has_one
133
+ # TODO change this warn message into a exception when
134
+ # associations are renamable
135
+ unless model[associated_resource]
136
+ console.warn("Associated factory not found for associated resource: #{associated_resource}")
137
+ continue
138
+
139
+ for scope in model[associated_resource].scope.declared
140
+ @[associated_resource][scope] = factory[scope]
141
+
133
142
  # TODO improve associable inner workings to stampit objects
134
- # if factory.belongs_to.length
135
- # generate_forwarder = (associated_resource) ->
136
- # associated_factory = model[associated_resource]
143
+ if factory.belongs_to.length
144
+ generate_forwarder = (associated_resource) ->
145
+ associated_factory = model[associated_resource]
137
146
 
138
- # # TODO change this warn message into a exception when
139
- # # associations are renamable
140
- # return console.warn("Associated factory not found for associated resource: #{associated_resource}") unless associated_factory
147
+ # TODO change this warn message into a exception when
148
+ # associations are renamable
149
+ return console.warn("Associated factory not found for associated resource: #{associated_resource}") unless associated_factory
141
150
 
142
- # declared_scopes = associated_factory.scope.declared
151
+ declared_scopes = associated_factory.scope.declared
143
152
 
144
- # ->
145
- # for scope in declared_scopes
146
- # @[associated_resource][scope] = associated_factory[scope]
153
+ ->
154
+ for scope in declared_scopes
155
+ @[associated_resource][scope] = associated_factory[scope]
147
156
 
148
- # for associated_resource in factory.belongs_to
149
- # forwarder = generate_forwarder associated_resource
150
- # @after "build_#{associated_resource}", forwarder
157
+ for associated_resource in factory.belongs_to
158
+ forwarder = generate_forwarder associated_resource
159
+ @after "build_#{associated_resource}", forwarder
151
160
 
152
161
  true
153
162
  # @ = model instance
@@ -244,14 +253,12 @@ if model.associable
244
253
  # TODO implement setter on this association and let user to set
245
254
  reload.done (records, status) ->
246
255
 
247
- # if no records were found by the server on this association
248
- unless records.length
249
- # Clear current stored cache on this association
250
- # it to an empty array
251
- Array.prototype.splice.call @, 0 if @length
252
-
253
- return true
256
+ # Clear current stored cache on this association
257
+ # it to an empty array
258
+ Array.prototype.splice.call @, 0
254
259
 
260
+ # return if no records were found by the server
261
+ return unless records.length
255
262
 
256
263
  singular_resource = model.singularize @resource
257
264
 
@@ -265,17 +272,8 @@ if model.associable
265
272
  record["#{association_name}_attributes"] = record[association_name]
266
273
  delete record[association_name]
267
274
 
268
- # Update found records
269
- # TODO create update method
270
- create = []
271
- for record, index in records
272
- if target = @find record._id
273
- target.assign_attributes record
274
- else
275
- create.push record
276
-
277
275
  # Load new records on this association
278
- @add.apply @, create
276
+ @add.apply @, records
279
277
 
280
278
  # Override the response records object with added to association records
281
279
  records.splice 0
@@ -292,4 +290,5 @@ if model.associable
292
290
 
293
291
  # TODO cache models
294
292
  @get().done (records) =>
295
- callback record for record in @
293
+ for record in @
294
+ callback record
@@ -173,18 +173,7 @@ extensions =
173
173
  @validation.fail failed
174
174
 
175
175
  # TODO store this callback
176
- @validation.done (record) ->
177
- # Disable dirty checking to prevent validation believe that
178
- # the model values has changed
179
- old_dirty = record.dirty
180
- record.dirty = null
181
-
182
- record.validated ||= true
183
-
184
- # Restore dirty state
185
- record.dirty = old_dirty
186
-
187
- record
176
+ @validation.done (record) -> record.validated ||= true
188
177
 
189
178
 
190
179
  # Validators management
@@ -121,11 +121,10 @@ describe 'model', ->
121
121
  beforeEach -> association = person().friends
122
122
 
123
123
  it 'should have query methods', ->
124
- association.should.have.property 'has_many'
125
- association.should.have.property 'find'
124
+ association.should.have.property 'all'
126
125
  association.should.have.property 'each'
127
126
  association.should.have.property 'reload'
128
127
 
129
- describe '#every', ->
128
+ describe '#all', ->
130
129
 
131
130
  it 'should auto observe nested associations attributes'