outpost-cms 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (391) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +19 -1
  3. data/Rakefile +0 -12
  4. data/app/assets/javascripts/outpost.js +1 -1
  5. data/app/assets/javascripts/outpost/auto_slug_field.js.coffee +6 -6
  6. data/app/assets/javascripts/outpost/date_time_input.js.coffee +13 -13
  7. data/app/assets/javascripts/outpost/field_counter.js.coffee +15 -15
  8. data/app/assets/javascripts/outpost/field_manager.js.coffee +3 -3
  9. data/app/assets/javascripts/outpost/global_plugins.js.coffee +16 -19
  10. data/app/assets/javascripts/outpost/index_manager.js.coffee +12 -12
  11. data/app/assets/javascripts/outpost/notification.js.coffee +33 -11
  12. data/app/assets/javascripts/outpost/preview.js.coffee +4 -4
  13. data/app/assets/javascripts/outpost/utilities.js.coffee +13 -0
  14. data/app/assets/stylesheets/outpost/_base.css.scss +9 -9
  15. data/app/assets/stylesheets/outpost/_forms.css.scss +28 -15
  16. data/app/assets/stylesheets/outpost/_index.css.scss +2 -2
  17. data/app/assets/stylesheets/outpost/_utility.css.scss +1 -1
  18. data/app/controllers/outpost/application_controller.rb +5 -3
  19. data/app/controllers/outpost/errors_controller.rb +2 -1
  20. data/app/controllers/outpost/resource_controller.rb +1 -1
  21. data/app/controllers/outpost/sessions_controller.rb +10 -5
  22. data/app/helpers/authorization_helper.rb +3 -3
  23. data/app/helpers/list_helper.rb +72 -49
  24. data/app/helpers/outpost_helper.rb +4 -4
  25. data/app/helpers/render_helper.rb +5 -5
  26. data/app/helpers/utility_helper.rb +5 -5
  27. data/app/models/permission.rb +8 -5
  28. data/app/views/layouts/outpost/application.html.erb +7 -7
  29. data/app/views/layouts/outpost/minimal.html.erb +1 -1
  30. data/app/views/outpost/errors/error_500.html.erb +1 -1
  31. data/app/views/outpost/resource/_errors.html.erb +2 -11
  32. data/app/views/outpost/resource/edit.html.erb +8 -4
  33. data/app/views/outpost/resource/new.html.erb +5 -1
  34. data/app/views/outpost/sessions/new.html.erb +1 -1
  35. data/app/views/outpost/shared/_filters.html.erb +2 -2
  36. data/app/views/outpost/shared/_form_block.html.erb +2 -2
  37. data/app/views/outpost/shared/_form_nav.html.erb +1 -1
  38. data/app/views/outpost/shared/_full_errors.html.erb +9 -0
  39. data/app/views/outpost/shared/_headers.html.erb +4 -4
  40. data/app/views/outpost/shared/_navigation.html.erb +4 -4
  41. data/app/views/outpost/shared/_submit_row.html.erb +5 -5
  42. data/lib/action_view/helpers/form_builder.rb +28 -16
  43. data/lib/outpost.rb +8 -5
  44. data/lib/outpost/breadcrumbs.rb +13 -11
  45. data/lib/outpost/config.rb +6 -6
  46. data/lib/outpost/controller.rb +8 -2
  47. data/lib/outpost/controller/actions.rb +3 -3
  48. data/lib/outpost/controller/authentication.rb +2 -1
  49. data/lib/outpost/controller/authorization.rb +3 -2
  50. data/lib/outpost/controller/callbacks.rb +2 -1
  51. data/lib/outpost/controller/custom_errors.rb +44 -13
  52. data/lib/outpost/controller/helpers.rb +1 -29
  53. data/lib/outpost/controller/ordering.rb +59 -16
  54. data/lib/outpost/controller/preferences.rb +3 -3
  55. data/lib/outpost/helpers/naming.rb +2 -2
  56. data/lib/outpost/hook.rb +5 -5
  57. data/lib/outpost/list.rb +3 -3
  58. data/lib/outpost/list/base.rb +23 -13
  59. data/lib/outpost/list/column.rb +13 -4
  60. data/lib/outpost/list/filter.rb +4 -4
  61. data/lib/outpost/model.rb +2 -2
  62. data/lib/outpost/model/authentication.rb +6 -2
  63. data/lib/outpost/model/authorization.rb +1 -2
  64. data/lib/outpost/model/identifier.rb +15 -10
  65. data/lib/outpost/model/methods.rb +2 -2
  66. data/lib/outpost/model/naming.rb +10 -7
  67. data/lib/outpost/model/routing.rb +6 -6
  68. data/lib/outpost/model/serializer.rb +3 -3
  69. data/lib/outpost/version.rb +1 -1
  70. data/spec/controllers/authentication_spec.rb +10 -10
  71. data/spec/controllers/sessions_controller_spec.rb +17 -17
  72. data/spec/factories.rb +1 -1
  73. data/spec/features/authentication_spec.rb +43 -0
  74. data/spec/features/authorization_spec.rb +28 -0
  75. data/spec/features/creating_spec.rb +44 -0
  76. data/spec/features/destroying_spec.rb +18 -0
  77. data/spec/features/editing_spec.rb +43 -0
  78. data/spec/features/save_options_spec.rb +35 -0
  79. data/spec/helpers/authorization_helper_spec.rb +8 -8
  80. data/spec/helpers/list_helper_spec.rb +34 -0
  81. data/spec/helpers/render_helper_spec.rb +1 -1
  82. data/spec/helpers/utility_helper_spec.rb +10 -10
  83. data/spec/internal/app/controllers/outpost/people_controller.rb +3 -3
  84. data/spec/internal/app/models/person.rb +3 -0
  85. data/spec/internal/config/routes.rb +1 -1
  86. data/spec/internal/db/combustion_test.sqlite +0 -0
  87. data/spec/internal/log/test.log +35260 -53251
  88. data/spec/internal/tmp/cache/assets/test/sass/20f5650af539e2cc0c7216330842920da53e851d/bootstrap.css.scssc +0 -0
  89. data/spec/internal/tmp/cache/assets/test/sass/20f5650af539e2cc0c7216330842920da53e851d/datepicker.css.scssc +0 -0
  90. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_alerts.scssc +0 -0
  91. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_breadcrumbs.scssc +0 -0
  92. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_button-groups.scssc +0 -0
  93. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_buttons.scssc +0 -0
  94. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_close.scssc +0 -0
  95. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_code.scssc +0 -0
  96. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_component-animations.scssc +0 -0
  97. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_dropdowns.scssc +0 -0
  98. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_forms.scssc +0 -0
  99. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_grid.scssc +0 -0
  100. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_labels-badges.scssc +0 -0
  101. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_layouts.scssc +0 -0
  102. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_mixins.scssc +0 -0
  103. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_modals.scssc +0 -0
  104. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_navbar.scssc +0 -0
  105. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_navs.scssc +0 -0
  106. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_pager.scssc +0 -0
  107. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_pagination.scssc +0 -0
  108. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_reset.scssc +0 -0
  109. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_scaffolding.scssc +0 -0
  110. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_sprites.scssc +0 -0
  111. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_tables.scssc +0 -0
  112. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_type.scssc +0 -0
  113. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_utilities.scssc +0 -0
  114. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_variables.scssc +0 -0
  115. data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_wells.scssc +0 -0
  116. data/spec/internal/tmp/cache/assets/test/sass/56c521c2866fc194cbbf1ead1ad9e7d727f5e7b3/select2.css.scssc +0 -0
  117. data/spec/internal/tmp/cache/assets/test/sass/87aa0c8b43c5e29ce88dd86b1a2c657232e4bb6f/outpost.css.scssc +0 -0
  118. data/spec/internal/tmp/cache/assets/test/sass/cde194af3b19eae3aef82845ab8bc0df6c0d84d4/select2.css.scssc +0 -0
  119. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_alerts.scssc +0 -0
  120. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_breadcrumbs.scssc +0 -0
  121. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_button-groups.scssc +0 -0
  122. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_buttons.scssc +0 -0
  123. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_close.scssc +0 -0
  124. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_code.scssc +0 -0
  125. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_component-animations.scssc +0 -0
  126. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_dropdowns.scssc +0 -0
  127. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_forms.scssc +0 -0
  128. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_grid.scssc +0 -0
  129. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_labels-badges.scssc +0 -0
  130. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_layouts.scssc +0 -0
  131. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_mixins.scssc +0 -0
  132. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_modals.scssc +0 -0
  133. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_navbar.scssc +0 -0
  134. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_navs.scssc +0 -0
  135. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_pager.scssc +0 -0
  136. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_pagination.scssc +0 -0
  137. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_reset.scssc +0 -0
  138. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_scaffolding.scssc +0 -0
  139. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_sprites.scssc +0 -0
  140. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_tables.scssc +0 -0
  141. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_type.scssc +0 -0
  142. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_utilities.scssc +0 -0
  143. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_variables.scssc +0 -0
  144. data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_wells.scssc +0 -0
  145. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_alerts.scssc +0 -0
  146. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_breadcrumbs.scssc +0 -0
  147. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_button-groups.scssc +0 -0
  148. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_buttons.scssc +0 -0
  149. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_close.scssc +0 -0
  150. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_code.scssc +0 -0
  151. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_component-animations.scssc +0 -0
  152. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_dropdowns.scssc +0 -0
  153. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_forms.scssc +0 -0
  154. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_grid.scssc +0 -0
  155. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_labels-badges.scssc +0 -0
  156. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_layouts.scssc +0 -0
  157. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_mixins.scssc +0 -0
  158. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_modals.scssc +0 -0
  159. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_navbar.scssc +0 -0
  160. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_navs.scssc +0 -0
  161. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_pager.scssc +0 -0
  162. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_pagination.scssc +0 -0
  163. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_reset.scssc +0 -0
  164. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_scaffolding.scssc +0 -0
  165. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_sprites.scssc +0 -0
  166. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_tables.scssc +0 -0
  167. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_type.scssc +0 -0
  168. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_utilities.scssc +0 -0
  169. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_variables.scssc +0 -0
  170. data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_wells.scssc +0 -0
  171. data/spec/internal/tmp/cache/assets/test/sass/e1eb86f6478445881765984079761fb4af85ab4e/select2.css.scssc +0 -0
  172. data/spec/internal/tmp/cache/assets/test/sass/ea24470654f74c1fe92aa45b2fae66b2a464a390/_base.css.scssc +0 -0
  173. data/spec/internal/tmp/cache/assets/test/sass/ea24470654f74c1fe92aa45b2fae66b2a464a390/_edit.css.scssc +0 -0
  174. data/spec/internal/tmp/cache/assets/test/sass/ea24470654f74c1fe92aa45b2fae66b2a464a390/_forms.css.scssc +0 -0
  175. data/spec/internal/tmp/cache/assets/test/sass/ea24470654f74c1fe92aa45b2fae66b2a464a390/_index.css.scssc +0 -0
  176. data/spec/internal/tmp/cache/assets/test/sass/ea24470654f74c1fe92aa45b2fae66b2a464a390/_utility.css.scssc +0 -0
  177. data/spec/internal/tmp/cache/assets/test/sass/ea24470654f74c1fe92aa45b2fae66b2a464a390/application.css.scssc +0 -0
  178. data/spec/internal/tmp/cache/assets/test/sass/ea24470654f74c1fe92aa45b2fae66b2a464a390/outpost.css.scssc +0 -0
  179. data/spec/internal/tmp/cache/assets/test/sass/ea24470654f74c1fe92aa45b2fae66b2a464a390/select2.css.scssc +0 -0
  180. data/spec/internal/tmp/cache/assets/test/sprockets/00154e1fc60e5765eb3704d402af06d1 +0 -0
  181. data/spec/internal/tmp/cache/assets/test/sprockets/0122e4f8c5576de5137307df7d6163a0 +0 -0
  182. data/spec/internal/tmp/cache/assets/test/sprockets/016db564806ffd72c90385066f2d1526 +0 -0
  183. data/spec/internal/tmp/cache/assets/test/sprockets/0185dbaba82d3fbc0fd9d2383dc7338d +0 -0
  184. data/spec/internal/tmp/cache/assets/test/sprockets/01a8e4b866eb7fc8ea5ed3941f1b1877 +0 -0
  185. data/spec/internal/tmp/cache/assets/test/sprockets/02713d4140ec033db3e897e7597c2096 +0 -0
  186. data/spec/internal/tmp/cache/assets/test/sprockets/0377ae38f0ab4fa7131b364012d9a4fa +0 -0
  187. data/spec/internal/tmp/cache/assets/test/sprockets/04effed13eef407140fbe39b6efae4b2 +0 -0
  188. data/spec/internal/tmp/cache/assets/test/sprockets/086d226e30e05ea260b6d01a4fbd8a29 +0 -0
  189. data/spec/internal/tmp/cache/assets/test/sprockets/0a032a3ea9ed2f90e27e350839fcc8dc +0 -0
  190. data/spec/internal/tmp/cache/assets/test/sprockets/0bc810339d0afdbe60e338e0041023cc +0 -0
  191. data/spec/internal/tmp/cache/assets/test/sprockets/0e167df01ba09061de9f5c49cfdccc99 +0 -0
  192. data/spec/internal/tmp/cache/assets/test/sprockets/0e69140d2c49ad3bd2a53e1a61ca911f +0 -0
  193. data/spec/internal/tmp/cache/assets/test/sprockets/15a87828df71925cca15a55b77afcf64 +0 -0
  194. data/spec/internal/tmp/cache/assets/test/sprockets/19b0f301c27628308ff1f81a322fcaa9 +0 -0
  195. data/spec/internal/tmp/cache/assets/test/sprockets/1b718773e74da99a05a30cc200c74d2b +0 -0
  196. data/spec/internal/tmp/cache/assets/test/sprockets/1d2a3ed3a5ee7d864dccd4feb0298858 +0 -0
  197. data/spec/internal/tmp/cache/assets/test/sprockets/1dfbb70993a8817b5e5aee44b888309d +0 -0
  198. data/spec/internal/tmp/cache/assets/test/sprockets/1e397e58ea65aa807232e81ba0646007 +0 -0
  199. data/spec/internal/tmp/cache/assets/test/sprockets/1e85a069dc1fa2fd3a325dd73115819a +0 -0
  200. data/spec/internal/tmp/cache/assets/test/sprockets/1fa01b5b6a31a3380b9f7926508624cb +0 -0
  201. data/spec/internal/tmp/cache/assets/test/sprockets/21f2bd9f5281712ad2d8c772fd407505 +0 -0
  202. data/spec/internal/tmp/cache/assets/test/sprockets/235664cdcf9cd81bf6a89a09e1e5711a +0 -0
  203. data/spec/internal/tmp/cache/assets/test/sprockets/23643a6f2a1f5c182681eca82a12b3b5 +0 -0
  204. data/spec/internal/tmp/cache/assets/test/sprockets/25f2c3cb96afc04742cb792a8adf703a +0 -0
  205. data/spec/internal/tmp/cache/assets/test/sprockets/26ad3186c36f3514d1028fb00180ed9c +0 -0
  206. data/spec/internal/tmp/cache/assets/test/sprockets/271f465e2ee560eee64005efa04346de +0 -0
  207. data/spec/internal/tmp/cache/assets/test/sprockets/29a5c683744eb88ed1292f59cd6063c9 +0 -0
  208. data/spec/internal/tmp/cache/assets/test/sprockets/2bb02e7009e6fec07e0ed0d01a1cf997 +0 -0
  209. data/spec/internal/tmp/cache/assets/test/sprockets/2cb954dcae3aa6f587625543070feb84 +0 -0
  210. data/spec/internal/tmp/cache/assets/test/sprockets/2f2c37a813522cd1889d2ebdfb2d2a66 +0 -0
  211. data/spec/internal/tmp/cache/assets/test/sprockets/316c469209d39a7bdac5c11828cf8d74 +0 -0
  212. data/spec/internal/tmp/cache/assets/test/sprockets/31be2b6ebd86190dc1ec80ce5f0833c5 +0 -0
  213. data/spec/internal/tmp/cache/assets/test/sprockets/36372f01bbdb43b410ec5192f7b6902f +0 -0
  214. data/spec/internal/tmp/cache/assets/test/sprockets/3717c6d6d1b1afd049b633417ed63cdd +0 -0
  215. data/spec/internal/tmp/cache/assets/test/sprockets/37abf1a201cc821dfc13cc427659a47b +0 -0
  216. data/spec/internal/tmp/cache/assets/test/sprockets/38341483f58eeea1d871954dbe986267 +0 -0
  217. data/spec/internal/tmp/cache/assets/test/sprockets/38aa3f8364fc8f118029ff4651c72221 +0 -0
  218. data/spec/internal/tmp/cache/assets/test/sprockets/3e5a01607dc58566739854e9f3ce5024 +0 -0
  219. data/spec/internal/tmp/cache/assets/test/sprockets/3f1c054c86b6510099f8e6c5dfe7ff3a +0 -0
  220. data/spec/internal/tmp/cache/assets/test/sprockets/3f744831928042565f7903a46a39791c +0 -0
  221. data/spec/internal/tmp/cache/assets/test/sprockets/3fadb5164d4b3caf81ef217fcde0d142 +0 -0
  222. data/spec/internal/tmp/cache/assets/test/sprockets/44020d882ece5491178ab3560f0d47a6 +0 -0
  223. data/spec/internal/tmp/cache/assets/test/sprockets/450ba61c4dc9c4cfa9f7efa5c9bba83d +0 -0
  224. data/spec/internal/tmp/cache/assets/test/sprockets/4543f412f8a876cd357e5888a4453e5d +0 -0
  225. data/spec/internal/tmp/cache/assets/test/sprockets/4a0eb5dbdb969be5257139300ae901a9 +0 -0
  226. data/spec/internal/tmp/cache/assets/test/sprockets/4ad30c03a35f4b46291c9c6331c43567 +0 -0
  227. data/spec/internal/tmp/cache/assets/test/sprockets/4c55f0b46f9bfc697010c07487d932e1 +0 -0
  228. data/spec/internal/tmp/cache/assets/test/sprockets/4d5649fe189b1fdead6428fdd2b9fafd +0 -0
  229. data/spec/internal/tmp/cache/assets/test/sprockets/4d779cbf3db6f14b3e022a5e5758d72d +0 -0
  230. data/spec/internal/tmp/cache/assets/test/sprockets/4ed642ba978ceb9502349fa8e6676440 +0 -0
  231. data/spec/internal/tmp/cache/assets/test/sprockets/4f6d52d657e0c1e635762f3edc6e8e20 +0 -0
  232. data/spec/internal/tmp/cache/assets/test/sprockets/50ae0bcf805250caf4ae4c4e01deebc9 +0 -0
  233. data/spec/internal/tmp/cache/assets/test/sprockets/53fc0263b1ce55a46ed55c461a2a8696 +0 -0
  234. data/spec/internal/tmp/cache/assets/test/sprockets/53fee1ff706022963c15ff24d5c53b54 +0 -0
  235. data/spec/internal/tmp/cache/assets/test/sprockets/54746a8bf1cdccbce2a3cfb4af05aef8 +0 -0
  236. data/spec/internal/tmp/cache/assets/test/sprockets/595ad1f5b58343141474f9211039df61 +0 -0
  237. data/spec/internal/tmp/cache/assets/test/sprockets/5c8c03be6364f23b4008487f351afa73 +0 -0
  238. data/spec/internal/tmp/cache/assets/test/sprockets/5d1e25ab219593639db982c901882c0f +0 -0
  239. data/spec/internal/tmp/cache/assets/test/sprockets/5d676e2352411dd3f05c6cee14727d1c +0 -0
  240. data/spec/internal/tmp/cache/assets/test/sprockets/5e2716f68ca78a5c0c83b157db90fc0d +0 -0
  241. data/spec/internal/tmp/cache/assets/test/sprockets/5e3f572f31041a301e0891c10f04604c +0 -0
  242. data/spec/internal/tmp/cache/assets/test/sprockets/620148b9ab753da9e8644581b619731b +0 -0
  243. data/spec/internal/tmp/cache/assets/test/sprockets/6471408d963e9165f8831b4bab80edd9 +0 -0
  244. data/spec/internal/tmp/cache/assets/test/sprockets/64a8cb638857a130dbabae4d1633618e +0 -0
  245. data/spec/internal/tmp/cache/assets/test/sprockets/6503f1ef9797aafce9339deb9200cfca +0 -0
  246. data/spec/internal/tmp/cache/assets/test/sprockets/6519463c3d8d8a34d743ef38eff5df45 +0 -0
  247. data/spec/internal/tmp/cache/assets/test/sprockets/656b07036edb74305c343f41eba55695 +0 -0
  248. data/spec/internal/tmp/cache/assets/test/sprockets/6571b577767caea14c3b89201d0643a2 +0 -0
  249. data/spec/internal/tmp/cache/assets/test/sprockets/6748f4abf46d0d2f516279ec032fd817 +0 -0
  250. data/spec/internal/tmp/cache/assets/test/sprockets/67a11a42996d51802481c92dc09c83fa +0 -0
  251. data/spec/internal/tmp/cache/assets/test/sprockets/6873baccb9ed57b839e83cfb93738955 +0 -0
  252. data/spec/internal/tmp/cache/assets/test/sprockets/6b9d79602e3b6ff9dd067605adeb0888 +0 -0
  253. data/spec/internal/tmp/cache/assets/test/sprockets/6c3df81c5fb88b555bafde4f54db7db2 +0 -0
  254. data/spec/internal/tmp/cache/assets/test/sprockets/6c62bea96eebf0f05624a859e8666f9a +0 -0
  255. data/spec/internal/tmp/cache/assets/test/sprockets/6cecd8ec655b80ac006bbec236b4263b +0 -0
  256. data/spec/internal/tmp/cache/assets/test/sprockets/700c635c138594de7ac50ad4b0420a0f +0 -0
  257. data/spec/internal/tmp/cache/assets/test/sprockets/70de8c6638b3ad61a4125dfb42e41f5b +0 -0
  258. data/spec/internal/tmp/cache/assets/test/sprockets/72a7339f697b2dcde9bd4835eaa42642 +0 -0
  259. data/spec/internal/tmp/cache/assets/test/sprockets/756eb63f1239c0a7a3d85253ddb5ca0d +0 -0
  260. data/spec/internal/tmp/cache/assets/test/sprockets/76e213ff5da12faa448078def3d32db5 +0 -0
  261. data/spec/internal/tmp/cache/assets/test/sprockets/76e3360cc08985753a1273cd40c3084a +0 -0
  262. data/spec/internal/tmp/cache/assets/test/sprockets/78f9aaf7b4a1253db9bdb2f2301a9b7d +0 -0
  263. data/spec/internal/tmp/cache/assets/test/sprockets/7ba5aaf62125e0b56d9e46603f5f8601 +0 -0
  264. data/spec/internal/tmp/cache/assets/test/sprockets/7e0d7eb383740100156a527b9e26d659 +0 -0
  265. data/spec/internal/tmp/cache/assets/test/sprockets/7e297a13578eea5ae51d5abb3be9df18 +0 -0
  266. data/spec/internal/tmp/cache/assets/test/sprockets/81670753eb8197bb1b9ca4d5a66a6fc5 +0 -0
  267. data/spec/internal/tmp/cache/assets/test/sprockets/896416332cf9f3e34262e6241b8237ef +0 -0
  268. data/spec/internal/tmp/cache/assets/test/sprockets/8b99288467087dc247c025d41444f377 +0 -0
  269. data/spec/internal/tmp/cache/assets/test/sprockets/8c123b8d3cc73220c5b69f99d2168389 +0 -0
  270. data/spec/internal/tmp/cache/assets/test/sprockets/8c5dcc180f78ee4957d754df726e2248 +0 -0
  271. data/spec/internal/tmp/cache/assets/test/sprockets/8e6315300501d34a896b82c0c0ceb70c +0 -0
  272. data/spec/internal/tmp/cache/assets/test/sprockets/90d6924223f69e10833fa8ef351e35ab +0 -0
  273. data/spec/internal/tmp/cache/assets/test/sprockets/9117ec941398c9b1340aa0b170ab2dc7 +0 -0
  274. data/spec/internal/tmp/cache/assets/test/sprockets/91d56ecde1551ea73ef462a44b77f650 +0 -0
  275. data/spec/internal/tmp/cache/assets/test/sprockets/9676f39584b5a04f92b29c0729175a8c +0 -0
  276. data/spec/internal/tmp/cache/assets/test/sprockets/9788c645f0c65ea7466be1dc13f64eea +0 -0
  277. data/spec/internal/tmp/cache/assets/test/sprockets/9add31bfd5f6aaa920af7f38211f9aa2 +0 -0
  278. data/spec/internal/tmp/cache/assets/test/sprockets/9b08bbf9ae722116682b8e22cb38c2ec +0 -0
  279. data/spec/internal/tmp/cache/assets/test/sprockets/9bc5469fea2a4926d4744c370bae613a +0 -0
  280. data/spec/internal/tmp/cache/assets/test/sprockets/9c1b3e8d4f1bab87ed819b82da42f535 +0 -0
  281. data/spec/internal/tmp/cache/assets/test/sprockets/9c736faedfe2dfe359042f9d2ce85367 +0 -0
  282. data/spec/internal/tmp/cache/assets/test/sprockets/9cf76f5ce68332b0f67c2f3b896a3475 +0 -0
  283. data/spec/internal/tmp/cache/assets/test/sprockets/9d484a2e742210fa6bc8be543c6331b9 +0 -0
  284. data/spec/internal/tmp/cache/assets/test/sprockets/9dd86c42f919be9f13a14317e7607f31 +0 -0
  285. data/spec/internal/tmp/cache/assets/test/sprockets/a0743c695fe7f2f40fc5f188fd054c2b +0 -0
  286. data/spec/internal/tmp/cache/assets/test/sprockets/a0b5c6371ce0b3308fc3be90c4f9ef5b +0 -0
  287. data/spec/internal/tmp/cache/assets/test/sprockets/a1e23f12c8163631dc3a2a98efd393a1 +0 -0
  288. data/spec/internal/tmp/cache/assets/test/sprockets/a2668b2b36e10c17a0a37e15af1adf92 +0 -0
  289. data/spec/internal/tmp/cache/assets/test/sprockets/a2d1f22b3a5164f8bdf8a2e08456d9c3 +0 -0
  290. data/spec/internal/tmp/cache/assets/test/sprockets/a458e44cf710f6e94208e22d3eafae3f +0 -0
  291. data/spec/internal/tmp/cache/assets/test/sprockets/a79a727e3b12ecb263735a8edecc86c2 +0 -0
  292. data/spec/internal/tmp/cache/assets/test/sprockets/aaa6c30950f43b707d50ee44229c1d0f +0 -0
  293. data/spec/internal/tmp/cache/assets/test/sprockets/ac25c69ce48ecf3a3a3808ba26537243 +0 -0
  294. data/spec/internal/tmp/cache/assets/test/sprockets/acb56c1b241b90a3a8694a04d7724e7d +0 -0
  295. data/spec/internal/tmp/cache/assets/test/sprockets/ad5315bf4cd3b8c4d38f662ef41c44d0 +0 -0
  296. data/spec/internal/tmp/cache/assets/test/sprockets/b0e1d9e51dba635c57573102d479dea9 +0 -0
  297. data/spec/internal/tmp/cache/assets/test/sprockets/b1a78635932522eb99a619b6e190b898 +0 -0
  298. data/spec/internal/tmp/cache/assets/test/sprockets/b236b354a0e5045c17b85a70f66e612d +0 -0
  299. data/spec/internal/tmp/cache/assets/test/sprockets/b2a3274db2081478a289f8eeee8370c7 +0 -0
  300. data/spec/internal/tmp/cache/assets/test/sprockets/b49f83c898ca822909d8d2c32470cfec +0 -0
  301. data/spec/internal/tmp/cache/assets/test/sprockets/b4c4d53c35d932c2b28bcefa990ec7fc +0 -0
  302. data/spec/internal/tmp/cache/assets/test/sprockets/b6f987547de2c90ebc0413d3263b87e8 +0 -0
  303. data/spec/internal/tmp/cache/assets/test/sprockets/b832658770b677e87a9d095ed3a87c47 +0 -0
  304. data/spec/internal/tmp/cache/assets/test/sprockets/b9d76e389aeda53d2f9cc256f75e303b +0 -0
  305. data/spec/internal/tmp/cache/assets/test/sprockets/bad56ba50db6ed97894b003103289ffe +0 -0
  306. data/spec/internal/tmp/cache/assets/test/sprockets/bb4e55b9b1a8a3bb8a8f0a10d4c6b074 +0 -0
  307. data/spec/internal/tmp/cache/assets/test/sprockets/bc8ba0b8c4f10524a604a7163f16e3dd +0 -0
  308. data/spec/internal/tmp/cache/assets/test/sprockets/bdfb9045b2f813ac4397c5cf0487f840 +0 -0
  309. data/spec/internal/tmp/cache/assets/test/sprockets/bf20d01df22f01e0fd66116d0ce58969 +0 -0
  310. data/spec/internal/tmp/cache/assets/test/sprockets/bf6fcb4c8c96d5406899b48c688e17a2 +0 -0
  311. data/spec/internal/tmp/cache/assets/test/sprockets/c0291860b6abb7bdc04ccc1e990e38f0 +0 -0
  312. data/spec/internal/tmp/cache/assets/test/sprockets/c1195a7d9d0e930545cda22ad40b0a9c +0 -0
  313. data/spec/internal/tmp/cache/assets/test/sprockets/c13a23e52c9d1956c61fb8540bfff8ef +0 -0
  314. data/spec/internal/tmp/cache/assets/test/sprockets/c1aa6b16696817c61530071b80c0cd43 +0 -0
  315. data/spec/internal/tmp/cache/assets/test/sprockets/c3954ed4f5e4dced91ee1240e4f90a05 +0 -0
  316. data/spec/internal/tmp/cache/assets/test/sprockets/c56fce185c88af8d191796b0172f498b +0 -0
  317. data/spec/internal/tmp/cache/assets/test/sprockets/c698133fe56541139a2f0d883ca07936 +0 -0
  318. data/spec/internal/tmp/cache/assets/test/sprockets/c7fcb613d0a346398fdf7a3a6ee722a1 +0 -0
  319. data/spec/internal/tmp/cache/assets/test/sprockets/c811799e9db5c939aab1e8e394df3b64 +0 -0
  320. data/spec/internal/tmp/cache/assets/test/sprockets/c9a027b847d199e99825ea85000303cf +0 -0
  321. data/spec/internal/tmp/cache/assets/test/sprockets/c9f12fd289b0f7e670ede1eeb8d3c24c +0 -0
  322. data/spec/internal/tmp/cache/assets/test/sprockets/c9f83bead35bd9bb5c671e327174c526 +0 -0
  323. data/spec/internal/tmp/cache/assets/test/sprockets/cb6a30f2c5219f77229df845e426ea71 +0 -0
  324. data/spec/internal/tmp/cache/assets/test/sprockets/cbbd567516b06004eb748f5a59bc14cc +0 -0
  325. data/spec/internal/tmp/cache/assets/test/sprockets/cbf827028b6168652324eb60180e21bd +0 -0
  326. data/spec/internal/tmp/cache/assets/test/sprockets/cc6766435593a06fcc9193244ea952a0 +0 -0
  327. data/spec/internal/tmp/cache/assets/test/sprockets/ccf22a7e27ed81a71d47f42a7cdb8e0e +0 -0
  328. data/spec/internal/tmp/cache/assets/test/sprockets/cd7d618755faec87f9c5cf47c6ae3365 +0 -0
  329. data/spec/internal/tmp/cache/assets/test/sprockets/cded6947b5642cfe05ffecc7a33ba54f +0 -0
  330. data/spec/internal/tmp/cache/assets/test/sprockets/d3638dad50702ecfe0e1b3bc8e07afc4 +0 -0
  331. data/spec/internal/tmp/cache/assets/test/sprockets/d5693a0bc9ebc317ed346946e8fe94ba +0 -0
  332. data/spec/internal/tmp/cache/assets/test/sprockets/d5c56cd3863549bedac1c7b3f28ae1d7 +0 -0
  333. data/spec/internal/tmp/cache/assets/test/sprockets/d6ba30bdd7d4b6d5205c150734acf5fa +0 -0
  334. data/spec/internal/tmp/cache/assets/test/sprockets/dd47254dcdc30cdbffbe6c32c57032fe +0 -0
  335. data/spec/internal/tmp/cache/assets/test/sprockets/dde6829bdb6fb77823831ab67644b76f +0 -0
  336. data/spec/internal/tmp/cache/assets/test/sprockets/ded9d8a2db25b4ab7f6d4f297208ded2 +0 -0
  337. data/spec/internal/tmp/cache/assets/test/sprockets/df8f0d31d3b82184ed7ded27b99b8ad4 +0 -0
  338. data/spec/internal/tmp/cache/assets/test/sprockets/e29bc5278f7e0bed414f714583faceee +0 -0
  339. data/spec/internal/tmp/cache/assets/test/sprockets/e461582472217950b63ee3247041e99c +0 -0
  340. data/spec/internal/tmp/cache/assets/test/sprockets/e521c94e59f66d600e517a555502fa11 +0 -0
  341. data/spec/internal/tmp/cache/assets/test/sprockets/e5be380a9dba4e6deae7a8511e4d7c13 +0 -0
  342. data/spec/internal/tmp/cache/assets/test/sprockets/e744b5ae603dc485f33ed176c899adfc +0 -0
  343. data/spec/internal/tmp/cache/assets/test/sprockets/e80c7be4df818b60928137fb7c450a43 +0 -0
  344. data/spec/internal/tmp/cache/assets/test/sprockets/e8edf2c8d66f7e31710f9aa5068d1155 +0 -0
  345. data/spec/internal/tmp/cache/assets/test/sprockets/ea8cf9239f191c63624cef6a3b6d2fbe +0 -0
  346. data/spec/internal/tmp/cache/assets/test/sprockets/ebb6acb80a5274f63d3ac5fd8df530b1 +0 -0
  347. data/spec/internal/tmp/cache/assets/test/sprockets/ebf2e1ad04f201369fb43454efc7bbd7 +0 -0
  348. data/spec/internal/tmp/cache/assets/test/sprockets/ec197b57d7a6b4163dac32744e3fa5b0 +0 -0
  349. data/spec/internal/tmp/cache/assets/test/sprockets/edb76e2e1ee82dc916a1086ca2d71de9 +0 -0
  350. data/spec/internal/tmp/cache/assets/test/sprockets/edc87d0b81267faccd7c5ada85675f9b +0 -0
  351. data/spec/internal/tmp/cache/assets/test/sprockets/ef4e09f768bb9330652eaa198bbd2c61 +0 -0
  352. data/spec/internal/tmp/cache/assets/test/sprockets/ef64bea489660cf5e30a6feb53bf3a5d +0 -0
  353. data/spec/internal/tmp/cache/assets/test/sprockets/f1b8af27ca9833a0ac2a5e10763efaa2 +0 -0
  354. data/spec/internal/tmp/cache/assets/test/sprockets/f5827ca48c75eb2925e0ae71f4545190 +0 -0
  355. data/spec/internal/tmp/cache/assets/test/sprockets/f60d687ea69fe491a8686efe8d6b3022 +0 -0
  356. data/spec/internal/tmp/cache/assets/test/sprockets/f66a526c31371958b5cd65928dd07d7f +0 -0
  357. data/spec/internal/tmp/cache/assets/test/sprockets/f6d577e76daa020d3df860c5dc7f8f61 +0 -0
  358. data/spec/internal/tmp/cache/assets/test/sprockets/f71d6134d0f24cb1de62de79100e19ee +0 -0
  359. data/spec/internal/tmp/cache/assets/test/sprockets/f7ace754f231b5ad97520f631ea60e01 +0 -0
  360. data/spec/internal/tmp/cache/assets/test/sprockets/f8f8cc64c68687e8c827d78d42ed93a4 +0 -0
  361. data/spec/internal/tmp/cache/assets/test/sprockets/fa2eaf4b4fc72c8cb321c6f9c022a55f +0 -0
  362. data/spec/internal/tmp/cache/assets/test/sprockets/fa32e1bd0e55873cd424ac5e7ce5c5ac +0 -0
  363. data/spec/internal/tmp/cache/assets/test/sprockets/fa9f906d3d676d23eac6d15f90f77876 +0 -0
  364. data/spec/internal/tmp/cache/assets/test/sprockets/fd8537c2a374241cc1d2d029ca4a3623 +0 -0
  365. data/spec/internal/tmp/cache/assets/test/sprockets/ff2e40602b14836c882af817459fa90e +0 -0
  366. data/spec/internal/tmp/capybara/capybara-201308160115352034044402.html +51 -0
  367. data/spec/internal/tmp/capybara/capybara-201308160118107572662369.html +140 -0
  368. data/spec/internal/tmp/capybara/capybara-201308160124322422773822.html +140 -0
  369. data/spec/internal/tmp/capybara/capybara-201308160216057700618069.html +71 -0
  370. data/spec/internal/tmp/capybara/capybara-201308160227299029704750.html +51 -0
  371. data/spec/internal/tmp/capybara/capybara-201308160227517375148134.html +51 -0
  372. data/spec/lib/breadcrumbs_spec.rb +5 -5
  373. data/spec/lib/config_spec.rb +11 -11
  374. data/spec/lib/controller/callbacks_spec.rb +1 -9
  375. data/spec/lib/controller/helpers_spec.rb +4 -4
  376. data/spec/lib/hook_spec.rb +1 -1
  377. data/spec/lib/list/base_spec.rb +18 -18
  378. data/spec/lib/list/column_spec.rb +4 -4
  379. data/spec/lib/list/filter_spec.rb +2 -2
  380. data/spec/lib/model/authentication_spec.rb +4 -4
  381. data/spec/lib/model/authorization_spec.rb +4 -4
  382. data/spec/lib/model/identifier_spec.rb +19 -18
  383. data/spec/lib/model/methods_spec.rb +1 -1
  384. data/spec/lib/model/naming_spec.rb +10 -10
  385. data/spec/lib/model/routing_spec.rb +14 -14
  386. data/spec/lib/model/serializer_spec.rb +1 -1
  387. data/spec/lib/outpost_spec.rb +5 -5
  388. data/spec/spec_helper.rb +7 -0
  389. data/spec/support/authentication_helper.rb +20 -0
  390. data/spec/support/authorization_helper.rb +13 -0
  391. metadata +632 -124
@@ -22,7 +22,7 @@ module Outpost
22
22
  def preference(key)
23
23
  session["preference_#{key}"]
24
24
  end
25
-
25
+
26
26
  # Public: Writer for preference.
27
27
  #
28
28
  # key - (String) The key to write to.
@@ -34,7 +34,7 @@ module Outpost
34
34
  # preference("posts_order")
35
35
  # # => "updated_at"
36
36
  #
37
- # Returns nothing.
37
+ # Returns nothing.
38
38
  def set_preference(key, value)
39
39
  session["preference_#{key}"] = value
40
40
  end
@@ -56,7 +56,7 @@ module Outpost
56
56
 
57
57
 
58
58
  private
59
-
59
+
60
60
  def remove_preferences
61
61
  Outpost.config.preferences.each do |preference|
62
62
  key = "#{model.content_key}_#{preference}"
@@ -10,8 +10,8 @@ module Outpost
10
10
  module Helpers
11
11
  module Naming
12
12
  extend self
13
-
14
- # These helpers expect a controller param,
13
+
14
+ # These helpers expect a controller param,
15
15
  # such as 'outpost/news_stories'
16
16
  # "outpost/news_stories" => NewsStory
17
17
  def to_class(controller)
data/lib/outpost/hook.rb CHANGED
@@ -5,24 +5,24 @@
5
5
  module Outpost
6
6
  class Hook
7
7
  attr_accessor :data, :path
8
-
8
+
9
9
  def initialize(options={})
10
10
  @path = options[:path]
11
11
  @data = options[:data] || { touch: true }
12
12
  end
13
-
13
+
14
14
  # Publish the message
15
15
  def publish
16
16
  response = connection.post do |request|
17
17
  request.url @path
18
18
  request.params = @data
19
19
  end
20
-
20
+
21
21
  response
22
22
  end
23
-
23
+
24
24
  private
25
-
25
+
26
26
  def connection
27
27
  @connection ||= begin
28
28
  Faraday.new(url: Rails.application.config.node.server) do |conn|
data/lib/outpost/list.rb CHANGED
@@ -4,9 +4,9 @@ module Outpost
4
4
  module List
5
5
  extend ActiveSupport::Autoload
6
6
 
7
- DEFAULT_ORDER = "id"
8
- DEFAULT_SORT_MODE = "desc"
9
- DEFAULT_PER_PAGE = 25
7
+ DEFAULT_ORDER_ATTRIBUTE = "id"
8
+ DEFAULT_ORDER_DIRECTION = DESCENDING
9
+ DEFAULT_PER_PAGE = 25
10
10
 
11
11
  autoload :Base
12
12
  autoload :Column
@@ -9,18 +9,27 @@ module Outpost
9
9
 
10
10
  yield self if block_given?
11
11
 
12
- @default_order ||= List::DEFAULT_ORDER
13
- @default_sort_mode ||= List::DEFAULT_SORT_MODE
14
- @per_page ||= List::DEFAULT_PER_PAGE
12
+ @default_order_attribute ||= List::DEFAULT_ORDER_ATTRIBUTE
13
+ @default_order_direction ||= List::DEFAULT_ORDER_DIRECTION
14
+ @per_page ||= List::DEFAULT_PER_PAGE
15
15
  end
16
16
 
17
- attr_accessor :default_order, :default_sort_mode
18
- attr_reader :columns, :fields, :filters, :per_page, :model
19
-
17
+
18
+ attr_accessor \
19
+ :default_order_attribute,
20
+ :default_order_direction
21
+
22
+ attr_reader \
23
+ :columns,
24
+ :fields,
25
+ :filters,
26
+ :per_page,
27
+ :model
28
+
20
29
  # Public: Set the per_page for pagination.
21
30
  #
22
31
  # val - (Integer) The value to send to pagination. Also accepts :all,
23
- # which passes `nil` to pagination and therefore will not
32
+ # which passes `nil` to pagination and therefore will not
24
33
  # paginate.
25
34
  #
26
35
  # Returns nothing.
@@ -31,13 +40,13 @@ module Outpost
31
40
  # Public: Add a column to the list.
32
41
  #
33
42
  # attribute - (String) The attribute that this column represents.
34
- # options - (Hash) A hash of options. Gets passed directly to
43
+ # options - (Hash) A hash of options. Gets passed directly to
35
44
  # List::Column (default: {}).
36
- # * header - (String) The title of the column, displayed in
37
- # the table header
45
+ # * header - (String) The title of the column, displayed in
46
+ # the table header
38
47
  # (default: self.attribute.titleize).
39
48
  # * display - (Symbol or Proc) How to display this attribute.
40
- # * If symbol, should be the name of a method in
49
+ # * If symbol, should be the name of a method in
41
50
  # AdminListHelper
42
51
  # * If Proc, gets run as an instance of the class.
43
52
  # * See AdminListHelper for more info.
@@ -46,7 +55,8 @@ module Outpost
46
55
  #
47
56
  # define_list do
48
57
  # column :name, header: "Full Name", display: :display_full_name
49
- # column :user, header: "Associated User", display: proc { self.user.name }
58
+ # column :user,
59
+ # header: "Associated User", display: proc { self.user.name }
50
60
  # end
51
61
  #
52
62
  # Returns nothing.
@@ -54,7 +64,7 @@ module Outpost
54
64
  column = Column.new(attribute, self, options)
55
65
  @columns[attribute] = column
56
66
  end
57
-
67
+
58
68
  # Public: Define a filter for the list.
59
69
  #
60
70
  # attribute - (String) The attribute on which to filter.
@@ -1,12 +1,20 @@
1
1
  module Outpost
2
2
  module List
3
3
  class Column
4
- attr_accessor :attribute, :display, :position, :list, :quick_edit,
5
- :sortable, :default_sort_mode, :_display_helper, :header
4
+ attr_accessor \
5
+ :attribute,
6
+ :display,
7
+ :position,
8
+ :list,
9
+ :quick_edit,
10
+ :sortable,
11
+ :default_order_direction,
12
+ :_display_helper,
13
+ :header
6
14
 
7
15
  alias_method :quick_edit?, :quick_edit
8
16
  alias_method :sortable?, :sortable
9
-
17
+
10
18
  def initialize(attribute, list, attributes={})
11
19
  @attribute = attribute.to_s
12
20
  @list = list
@@ -17,7 +25,8 @@ module Outpost
17
25
  @quick_edit = !!attributes[:quick_edit]
18
26
  @sortable = !!attributes[:sortable]
19
27
 
20
- @default_sort_mode = attributes[:default_sort_mode] || List::DEFAULT_SORT_MODE
28
+ @default_order_direction =
29
+ attributes[:default_order_direction] || List::DEFAULT_ORDER_DIRECTION
21
30
  end
22
31
  end
23
32
  end
@@ -7,12 +7,12 @@ module Outpost
7
7
  BOOLEAN_COLLECT = [["Yes", 1], ["No", 0]]
8
8
 
9
9
  attr_accessor :attribute, :collection, :title, :list
10
-
10
+
11
11
  def initialize(attribute, list, options={})
12
12
  @attribute = attribute.to_s
13
13
  @list = list
14
14
  @title = options[:title] || @attribute.titleize
15
-
15
+
16
16
  collection = options[:collection]
17
17
  @collection = begin
18
18
  case collection
@@ -25,10 +25,10 @@ module Outpost
25
25
  end
26
26
  end
27
27
  end
28
-
28
+
29
29
 
30
30
  private
31
-
31
+
32
32
  def _boolean_collection
33
33
  -> { BOOLEAN_COLLECT }
34
34
  end
data/lib/outpost/model.rb CHANGED
@@ -4,7 +4,7 @@ module Outpost
4
4
  module Model
5
5
  extend ActiveSupport::Concern
6
6
  extend ActiveSupport::Autoload
7
-
7
+
8
8
  autoload :Authentication
9
9
  autoload :Authorization
10
10
  autoload :Methods
@@ -12,7 +12,7 @@ module Outpost
12
12
  autoload :Routing
13
13
  autoload :Naming
14
14
  autoload :Serializer
15
-
15
+
16
16
  module ClassMethods
17
17
  def outpost_model
18
18
  include Methods, Identifier, Routing, Naming, Serializer
@@ -7,13 +7,17 @@ module Outpost
7
7
  has_secure_password
8
8
 
9
9
  before_validation :downcase_email, if: -> { self.email_changed? }
10
+
10
11
  validates :name, presence: true
11
- validates Outpost.config.authentication_attribute, presence: true, uniqueness: true
12
+ validates Outpost.config.authentication_attribute,
13
+ :presence => true,
14
+ :uniqueness => true
12
15
  end
13
16
 
14
17
  module ClassMethods
15
18
  def authenticate(login, unencrypted_password)
16
- if user = self.send("find_by_#{Outpost.config.authentication_attribute}", login)
19
+ if user = self.send(
20
+ "find_by_#{Outpost.config.authentication_attribute}", login)
17
21
  user.authenticate(unencrypted_password)
18
22
  else
19
23
  false
@@ -7,6 +7,7 @@ module Outpost
7
7
  has_many :user_permissions
8
8
  has_many :permissions, through: :user_permissions
9
9
  end
10
+
10
11
  # Check if a user can manage the passed-in resource(s)
11
12
  #
12
13
  # If multiple resources are passed in, a user must be
@@ -19,8 +20,6 @@ module Outpost
19
20
  self.is_superuser? or (allowed_resources & resources) == resources
20
21
  end
21
22
 
22
- #
23
-
24
23
  def allowed_resources
25
24
  @allowed_resources ||= begin
26
25
  p = self.is_superuser? ? Permission.all : self.permissions
@@ -8,31 +8,36 @@ module Outpost
8
8
  module Identifier
9
9
  extend ActiveSupport::Concern
10
10
 
11
-
11
+ OBJ_KEY_SEPARATOR = "-"
12
+
12
13
  module ClassMethods
13
14
  def content_key
14
- if self.respond_to? :table_name
15
- self.table_name.gsub(/_/, "/")
16
- else
17
- self.name.tableize
18
- end
15
+ self.name.tableize.singularize
16
+ end
17
+
18
+ def obj_key(id)
19
+ [self.content_key, id || "new"].join(OBJ_KEY_SEPARATOR)
20
+ end
21
+
22
+ def new_obj_key
23
+ obj_key(nil)
19
24
  end
20
-
25
+
21
26
  # Wrappers for ActiveModel::Naming
22
27
  # NewsStory => news_stories
23
28
  def route_key
24
29
  ActiveModel::Naming.route_key(self)
25
30
  end
26
-
31
+
27
32
  # NewsStory => news_story
28
33
  def singular_route_key
29
34
  ActiveModel::Naming.singular_route_key(self)
30
35
  end
31
36
  end
32
-
37
+
33
38
  # Default obj_key pattern
34
39
  def obj_key
35
- @obj_key ||= [self.class.content_key,self.id || "new"].join(":")
40
+ @obj_key ||= self.class.obj_key(self.id)
36
41
  end
37
42
  end # Identifier
38
43
  end # Model
@@ -6,12 +6,12 @@ module Outpost
6
6
  module Model
7
7
  module Methods
8
8
  extend ActiveSupport::Concern
9
-
9
+
10
10
  def persisted_record
11
11
  @persisted_record ||= begin
12
12
  # If this record isn't persisted, return nil
13
13
  return nil if !self.persisted?
14
-
14
+
15
15
  # If attributes have been changed, then fetch
16
16
  # the persisted record from the database
17
17
  # Otherwise just use self
@@ -6,14 +6,14 @@ module Outpost
6
6
  module Model
7
7
  module Naming
8
8
  extend ActiveSupport::Concern
9
-
9
+
10
10
  module ClassMethods
11
11
  # NewsStory => News Story
12
12
  def to_title
13
13
  self.name.demodulize.titleize
14
14
  end
15
15
  end
16
-
16
+
17
17
  # Convert any AR object into a human-readable title
18
18
  # Tries the attributes in config.title_attributes
19
19
  # And falls back to "BlogEntry #99"
@@ -30,9 +30,12 @@ module Outpost
30
30
  #
31
31
  # Usage:
32
32
  #
33
- # story = NewsStory.last #=> NewsStory(id: 900, title: "Cool Story, Bro")
34
- # blog = Blog.last #=> Blog(id: 5, name: "Some Blog")
35
- # photo = Photo.last #=> Photo(id: 10, url: "http://photos.com/kitty")
33
+ # story = NewsStory.last
34
+ # #=> NewsStory(id: 900, title: "Cool Story, Bro")
35
+ # blog = Blog.last
36
+ # #=> Blog(id: 5, name: "Some Blog")
37
+ # photo = Photo.last
38
+ # #=> Photo(id: 10, url: "http://photos.com/kitty")
36
39
  #
37
40
  # story.to_title #=> "Cool Story, Bro"
38
41
  # blog.to_title #=> "Some Blog"
@@ -44,11 +47,11 @@ module Outpost
44
47
  attributes.find { |a| self.respond_to?(a) }
45
48
  end
46
49
  end
47
-
50
+
48
51
  def to_title
49
52
  @to_title ||= self.send(self.title_method)
50
53
  end
51
-
54
+
52
55
  def simple_title
53
56
  @simple_title ||= begin
54
57
  if self.new_record?
@@ -20,13 +20,13 @@ module Outpost
20
20
  # even though they are the same path.
21
21
  module Routing
22
22
  extend ActiveSupport::Concern
23
-
23
+
24
24
  module ClassMethods
25
25
  # /outpost/blog_entries/new
26
26
  def admin_new_path
27
27
  collection_route("new_outpost_#{self.singular_route_key}_path")
28
28
  end
29
-
29
+
30
30
  # http://kpcc.org/outpost/blog_entries/new
31
31
  def admin_new_url
32
32
  collection_route("new_outpost_#{self.singular_route_key}_url")
@@ -37,7 +37,7 @@ module Outpost
37
37
  def admin_index_path
38
38
  collection_route("outpost_#{self.route_key}_path")
39
39
  end
40
-
40
+
41
41
  alias_method :admin_create_path, :admin_index_path
42
42
 
43
43
  # http://kpcc.org/outpost/blog_entries
@@ -83,13 +83,13 @@ module Outpost
83
83
  alias_method :admin_update_url, :admin_show_url
84
84
  alias_method :admin_destroy_url, :admin_show_url
85
85
 
86
-
86
+
87
87
  # Uses self.class::ROUTE_KEY to generate
88
88
  # the front-end path to this object
89
89
  # If an object doesn't have a front-end path,
90
90
  # do not define a ROUTE_KEY on the class.
91
91
  #
92
- # If the object isn't public, then leave route_hash
92
+ # If the object isn't public, then leave route_hash
93
93
  # empty as well.
94
94
  def public_path(options={})
95
95
  if self.route_hash.present? && defined?(self.class::ROUTE_KEY)
@@ -110,7 +110,7 @@ module Outpost
110
110
  def route_hash
111
111
  {}
112
112
  end
113
-
113
+
114
114
 
115
115
  # http://scpr.org/blogs/2012/...
116
116
  def public_url(options={})
@@ -2,20 +2,20 @@ module Outpost
2
2
  module Model
3
3
  module Serializer
4
4
  extend ActiveSupport::Concern
5
-
5
+
6
6
  # This method should be overridden
7
7
  # Don't override as_json unless you don't
8
8
  # want its baked-in goodies
9
9
  def json
10
10
  {}
11
11
  end
12
-
12
+
13
13
  # Define some defaults for as_json
14
14
  # Override +#json+ to add attributes
15
15
  # or override any of these.
16
16
  def as_json(*args)
17
17
  super.merge({
18
- "id" => self.obj_key,
18
+ "id" => self.obj_key,
19
19
  "obj_key" => self.obj_key,
20
20
  "link_path" => self.public_path,
21
21
  "to_title" => self.to_title,