disco_app 0.14.4 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (429) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -5
  3. data/app/clients/disco_app/api_client.rb +5 -4
  4. data/app/clients/disco_app/graphql_client.rb +85 -0
  5. data/app/controllers/disco_app/admin/app_settings_controller.rb +2 -0
  6. data/app/controllers/disco_app/admin/application_controller.rb +1 -0
  7. data/app/controllers/disco_app/admin/concerns/app_settings_controller.rb +2 -1
  8. data/app/controllers/disco_app/admin/concerns/authenticated_controller.rb +5 -3
  9. data/app/controllers/disco_app/admin/concerns/plans_controller.rb +3 -2
  10. data/app/controllers/disco_app/admin/concerns/shops_controller.rb +1 -0
  11. data/app/controllers/disco_app/admin/concerns/sources_controller.rb +2 -1
  12. data/app/controllers/disco_app/admin/concerns/subscriptions_controller.rb +3 -2
  13. data/app/controllers/disco_app/admin/plans_controller.rb +2 -0
  14. data/app/controllers/disco_app/admin/resources/shops_controller.rb +2 -0
  15. data/app/controllers/disco_app/admin/shops_controller.rb +2 -0
  16. data/app/controllers/disco_app/admin/sources_controller.rb +2 -0
  17. data/app/controllers/disco_app/admin/subscriptions_controller.rb +2 -0
  18. data/app/controllers/disco_app/charges_controller.rb +6 -7
  19. data/app/controllers/disco_app/concerns/app_proxy_controller.rb +6 -6
  20. data/app/controllers/disco_app/concerns/authenticated_controller.rb +24 -25
  21. data/app/controllers/disco_app/concerns/carrier_request_controller.rb +22 -11
  22. data/app/controllers/disco_app/concerns/user_authenticated_controller.rb +1 -0
  23. data/app/controllers/disco_app/concerns/webhooks_controller.rb +49 -0
  24. data/app/controllers/disco_app/flow/actions_controller.rb +9 -0
  25. data/app/controllers/disco_app/flow/concerns/actions_controller.rb +50 -0
  26. data/app/controllers/disco_app/frame_controller.rb +0 -1
  27. data/app/controllers/disco_app/install_controller.rb +3 -6
  28. data/app/controllers/disco_app/subscriptions_controller.rb +12 -4
  29. data/app/controllers/disco_app/user_sessions_controller.rb +1 -0
  30. data/app/controllers/disco_app/webhooks_controller.rb +2 -44
  31. data/app/controllers/sessions_controller.rb +4 -3
  32. data/app/helpers/disco_app/application_helper.rb +7 -7
  33. data/app/jobs/disco_app/app_installed_job.rb +2 -0
  34. data/app/jobs/disco_app/app_uninstalled_job.rb +2 -0
  35. data/app/jobs/disco_app/concerns/app_installed_job.rb +2 -3
  36. data/app/jobs/disco_app/concerns/app_uninstalled_job.rb +2 -1
  37. data/app/jobs/disco_app/concerns/render_asset_group_job.rb +1 -0
  38. data/app/jobs/disco_app/concerns/shop_update_job.rb +9 -2
  39. data/app/jobs/disco_app/concerns/subscription_changed_job.rb +2 -1
  40. data/app/jobs/disco_app/concerns/synchronise_carrier_service_job.rb +8 -7
  41. data/app/jobs/disco_app/concerns/synchronise_resources_job.rb +1 -0
  42. data/app/jobs/disco_app/concerns/synchronise_users_job.rb +6 -3
  43. data/app/jobs/disco_app/concerns/synchronise_webhooks_job.rb +4 -5
  44. data/app/jobs/disco_app/flow/process_action_job.rb +11 -0
  45. data/app/jobs/disco_app/flow/process_trigger_job.rb +11 -0
  46. data/app/jobs/disco_app/render_asset_group_job.rb +2 -0
  47. data/app/jobs/disco_app/shop_job.rb +10 -10
  48. data/app/jobs/disco_app/shop_update_job.rb +2 -0
  49. data/app/jobs/disco_app/subscription_changed_job.rb +2 -0
  50. data/app/jobs/disco_app/synchronise_carrier_service_job.rb +2 -0
  51. data/app/jobs/disco_app/synchronise_resources_job.rb +2 -0
  52. data/app/jobs/disco_app/synchronise_users_job.rb +2 -0
  53. data/app/jobs/disco_app/synchronise_webhooks_job.rb +2 -0
  54. data/app/models/application_record.rb +2 -0
  55. data/app/models/disco_app/app_settings.rb +2 -0
  56. data/app/models/disco_app/application_charge.rb +1 -1
  57. data/app/models/disco_app/concerns/app_settings.rb +2 -0
  58. data/app/models/disco_app/concerns/can_be_liquified.rb +29 -14
  59. data/app/models/disco_app/concerns/has_metafields.rb +1 -2
  60. data/app/models/disco_app/concerns/plan.rb +3 -4
  61. data/app/models/disco_app/concerns/plan_code.rb +1 -2
  62. data/app/models/disco_app/concerns/renders_assets.rb +14 -18
  63. data/app/models/disco_app/concerns/shop.rb +11 -12
  64. data/app/models/disco_app/concerns/source.rb +2 -3
  65. data/app/models/disco_app/concerns/subscription.rb +3 -3
  66. data/app/models/disco_app/concerns/synchronises.rb +10 -15
  67. data/app/models/disco_app/concerns/taggable.rb +1 -0
  68. data/app/models/disco_app/concerns/user.rb +3 -2
  69. data/app/models/disco_app/flow/action.rb +9 -0
  70. data/app/models/disco_app/flow/concerns/action.rb +27 -0
  71. data/app/models/disco_app/flow/concerns/trigger.rb +27 -0
  72. data/app/models/disco_app/flow/trigger.rb +9 -0
  73. data/app/models/disco_app/plan.rb +2 -0
  74. data/app/models/disco_app/plan_code.rb +2 -0
  75. data/app/models/disco_app/session_storage.rb +3 -0
  76. data/app/models/disco_app/shop.rb +2 -0
  77. data/app/models/disco_app/source.rb +2 -0
  78. data/app/models/disco_app/subscription.rb +2 -0
  79. data/app/models/disco_app/user.rb +2 -0
  80. data/app/resources/disco_app/admin/resources/concerns/shop_resource.rb +12 -15
  81. data/app/resources/disco_app/admin/resources/shop_resource.rb +1 -0
  82. data/app/services/disco_app/carrier_request_service.rb +3 -3
  83. data/app/services/disco_app/charges_service.rb +26 -34
  84. data/app/services/disco_app/flow/create_action.rb +35 -0
  85. data/app/services/disco_app/flow/create_trigger.rb +34 -0
  86. data/app/services/disco_app/flow/process_action.rb +50 -0
  87. data/app/services/disco_app/flow/process_trigger.rb +52 -0
  88. data/app/services/disco_app/partner_app_service.rb +1 -1
  89. data/app/services/disco_app/proxy_service.rb +2 -2
  90. data/app/services/disco_app/request_validation_service.rb +2 -2
  91. data/app/services/disco_app/subscription_service.rb +60 -32
  92. data/app/services/disco_app/webhook_service.rb +9 -11
  93. data/config/routes.rb +7 -3
  94. data/db/migrate/20150525000000_create_shops_if_not_existent.rb +80 -80
  95. data/db/migrate/20170315062548_create_disco_app_sources.rb +2 -0
  96. data/db/migrate/20170315062629_add_sources_to_shop_subscriptions.rb +3 -1
  97. data/db/migrate/20170327214540_create_disco_app_users.rb +2 -1
  98. data/db/migrate/20170606160751_fix_disco_app_users_index.rb +2 -0
  99. data/db/migrate/20181229100327_create_flow_actions_and_triggers.rb +32 -0
  100. data/lib/disco_app/configuration.rb +9 -5
  101. data/lib/disco_app/constants.rb +4 -2
  102. data/lib/disco_app/engine.rb +1 -1
  103. data/lib/disco_app/session.rb +1 -0
  104. data/lib/disco_app/support/file_fixtures.rb +2 -1
  105. data/lib/disco_app/version.rb +3 -1
  106. data/lib/generators/disco_app/install/USAGE +5 -0
  107. data/lib/generators/disco_app/install/install_generator.rb +287 -0
  108. data/lib/generators/disco_app/{templates → install/templates}/assets/javascripts/application.js +0 -0
  109. data/lib/generators/disco_app/{templates → install/templates}/assets/javascripts/components.js +0 -0
  110. data/lib/generators/disco_app/{templates → install/templates}/assets/stylesheets/application.scss +0 -0
  111. data/lib/generators/disco_app/install/templates/config/appsignal.yml +12 -0
  112. data/lib/generators/disco_app/install/templates/config/cable.yml.tt +11 -0
  113. data/lib/generators/disco_app/{templates → install/templates}/config/database.yml.tt +6 -3
  114. data/lib/generators/disco_app/install/templates/config/environments/staging.rb +108 -0
  115. data/lib/generators/disco_app/{templates → install/templates}/config/puma.rb +0 -0
  116. data/lib/generators/disco_app/{templates → install/templates}/controllers/home_controller.rb +1 -0
  117. data/lib/generators/disco_app/{templates → install/templates}/initializers/disco_app.rb +0 -0
  118. data/lib/generators/disco_app/install/templates/initializers/session_store.rb +2 -0
  119. data/lib/generators/disco_app/{templates → install/templates}/initializers/shopify_app.rb +0 -0
  120. data/lib/generators/disco_app/{templates → install/templates}/initializers/shopify_session_repository.rb +0 -0
  121. data/lib/generators/disco_app/install/templates/initializers/timber.rb +6 -0
  122. data/lib/generators/disco_app/{templates → install/templates}/root/.editorconfig +0 -0
  123. data/lib/generators/disco_app/{templates → install/templates}/root/.env +3 -0
  124. data/lib/generators/disco_app/{templates → install/templates}/root/.env.local +3 -0
  125. data/lib/generators/disco_app/install/templates/root/.github/PULL_REQUEST_TEMPLATE.md +18 -0
  126. data/lib/generators/disco_app/{templates → install/templates}/root/.gitignore +10 -0
  127. data/lib/generators/disco_app/install/templates/root/.rspec +1 -0
  128. data/lib/generators/disco_app/{templates → install/templates}/root/.rubocop.yml +263 -170
  129. data/lib/generators/disco_app/{templates → install/templates}/root/.ruby-version +0 -0
  130. data/lib/generators/disco_app/{templates → install/templates}/root/CHECKS +0 -0
  131. data/lib/generators/disco_app/{templates → install/templates}/root/Procfile +0 -0
  132. data/lib/generators/disco_app/{templates → install/templates}/root/README.md +0 -0
  133. data/lib/generators/disco_app/install/templates/spec/rails_helper.rb +40 -0
  134. data/lib/generators/disco_app/install/templates/spec/spec_helper.rb +24 -0
  135. data/lib/generators/disco_app/install/templates/spec/support/active_job.rb +13 -0
  136. data/lib/generators/disco_app/install/templates/spec/support/coveralls.rb +3 -0
  137. data/lib/generators/disco_app/install/templates/spec/support/database_cleaner.rb +17 -0
  138. data/lib/generators/disco_app/install/templates/spec/support/factory_bot.rb +3 -0
  139. data/lib/generators/disco_app/install/templates/spec/support/helpers/json_helper.rb +13 -0
  140. data/lib/generators/disco_app/install/templates/spec/support/shared_examples/a_synchronise_job.rb +12 -0
  141. data/lib/generators/disco_app/install/templates/spec/support/shoulda.rb +6 -0
  142. data/lib/generators/disco_app/install/templates/spec/support/vcr.rb +14 -0
  143. data/lib/generators/disco_app/install/templates/spec/support/webmock.rb +8 -0
  144. data/lib/generators/disco_app/{templates → install/templates}/views/home/index.html.erb +0 -0
  145. data/lib/generators/disco_app/react/USAGE +5 -0
  146. data/lib/generators/disco_app/react/react_generator.rb +108 -0
  147. data/lib/generators/disco_app/react/templates/app/controllers/embedded/api/base_controller.rb +18 -0
  148. data/lib/generators/disco_app/react/templates/app/controllers/embedded/api/home_controller.rb +10 -0
  149. data/lib/generators/disco_app/react/templates/app/controllers/embedded/api/shops_controller.rb +11 -0
  150. data/lib/generators/disco_app/react/templates/app/controllers/embedded/api/users_controller.rb +11 -0
  151. data/lib/generators/disco_app/react/templates/app/controllers/embedded/home_controller.rb +13 -0
  152. data/lib/generators/disco_app/react/templates/app/models/api_response.rb +107 -0
  153. data/lib/generators/disco_app/react/templates/app/serializers/disco_app/shop_serializer.rb +13 -0
  154. data/lib/generators/disco_app/react/templates/app/serializers/disco_app/user_serializer.rb +13 -0
  155. data/lib/generators/disco_app/react/templates/app/serializers/empty_serializer.rb +5 -0
  156. data/lib/generators/disco_app/react/templates/app/serializers/error_serializer.rb +76 -0
  157. data/lib/generators/disco_app/react/templates/app/views/embedded/home/index.html.erb +12 -0
  158. data/lib/generators/disco_app/react/templates/app/views/layouts/embedded.html.erb +10 -0
  159. data/lib/generators/disco_app/react/templates/app/webpack/javascripts/embedded/components/App.jsx +77 -0
  160. data/lib/generators/disco_app/react/templates/app/webpack/javascripts/embedded/components/HomePage.jsx +34 -0
  161. data/lib/generators/disco_app/react/templates/app/webpack/javascripts/embedded/components/Shared/EmbeddedPage.jsx +70 -0
  162. data/lib/generators/disco_app/react/templates/app/webpack/javascripts/embedded/components/Shared/ErrorBanner.jsx +58 -0
  163. data/lib/generators/disco_app/react/templates/app/webpack/javascripts/embedded/components/Shared/PaginationWrapper.jsx +10 -0
  164. data/lib/generators/disco_app/react/templates/app/webpack/javascripts/embedded/components/Shared/ScrollToTop.jsx +23 -0
  165. data/lib/generators/disco_app/react/templates/app/webpack/javascripts/embedded/components/withApi.jsx +125 -0
  166. data/lib/generators/disco_app/react/templates/app/webpack/javascripts/embedded/index.jsx +39 -0
  167. data/lib/generators/disco_app/react/templates/app/webpack/javascripts/embedded/utils.js +19 -0
  168. data/lib/generators/disco_app/react/templates/app/webpack/packs/embedded.js +2 -0
  169. data/lib/generators/disco_app/react/templates/app/webpack/stylesheets/embedded/shared/banners.scss +7 -0
  170. data/lib/generators/disco_app/react/templates/app/webpack/stylesheets/embedded/shared/busy.scss +3 -0
  171. data/lib/generators/disco_app/react/templates/app/webpack/stylesheets/embedded/shared/index.scss +3 -0
  172. data/lib/generators/disco_app/react/templates/app/webpack/stylesheets/embedded/shared/pagination.scss +5 -0
  173. data/lib/generators/disco_app/react/templates/app/webpack/stylesheets/embedded.scss +2 -0
  174. data/lib/generators/disco_app/react/templates/config/initializers/mime_types.rb +13 -0
  175. data/lib/generators/disco_app/react/templates/config/initializers/omniauth.rb +27 -0
  176. data/lib/generators/disco_app/react/templates/config/initializers/version.rb.tt +7 -0
  177. data/lib/generators/disco_app/react/templates/config/webpack/staging.js +5 -0
  178. data/lib/generators/disco_app/react/templates/config/webpack/test.js +5 -0
  179. data/lib/generators/disco_app/react/templates/config/webpacker.yml +96 -0
  180. data/lib/generators/disco_app/react/templates/root/.eslintignore +5 -0
  181. data/lib/generators/disco_app/react/templates/root/.eslintrc +69 -0
  182. data/lib/generators/disco_app/react/templates/root/.prettierrc +3 -0
  183. data/lib/generators/disco_app/react/templates/root/VERSION +1 -0
  184. data/lib/generators/disco_app/react/templates/root/babel.config.js +72 -0
  185. data/lib/generators/disco_app/react/templates/root/package.json.tt +84 -0
  186. data/lib/generators/disco_app/react/templates/root/postcss.config.js +14 -0
  187. data/lib/tasks/api.rake +0 -2
  188. data/lib/tasks/carrier_service.rake +0 -2
  189. data/lib/tasks/database.rake +1 -1
  190. data/lib/tasks/sessions.rake +0 -2
  191. data/lib/tasks/shops.rake +0 -2
  192. data/lib/tasks/users.rake +0 -2
  193. data/lib/tasks/webhooks.rake +0 -2
  194. data/test/clients/disco_app/api_client_test.rb +3 -3
  195. data/test/controllers/disco_app/admin/shops_controller_test.rb +1 -0
  196. data/test/controllers/disco_app/charges_controller_test.rb +7 -8
  197. data/test/controllers/disco_app/install_controller_test.rb +2 -1
  198. data/test/controllers/disco_app/subscriptions_controller_test.rb +1 -0
  199. data/test/controllers/disco_app/webhooks_controller_test.rb +1 -0
  200. data/test/controllers/home_controller_test.rb +1 -1
  201. data/test/disco_app_test.rb +3 -1
  202. data/test/dummy/Rakefile +1 -1
  203. data/test/dummy/app/controllers/application_controller.rb +2 -0
  204. data/test/dummy/app/controllers/carrier_request_controller.rb +1 -0
  205. data/test/dummy/app/controllers/disco_app/admin/shops_controller.rb +1 -0
  206. data/test/dummy/app/controllers/home_controller.rb +1 -0
  207. data/test/dummy/app/controllers/proxy_controller.rb +1 -0
  208. data/test/dummy/app/jobs/disco_app/app_installed_job.rb +2 -3
  209. data/test/dummy/app/jobs/disco_app/app_uninstalled_job.rb +1 -0
  210. data/test/dummy/app/models/application_record.rb +2 -0
  211. data/test/dummy/app/models/cart.rb +4 -3
  212. data/test/dummy/app/models/disco_app/shop.rb +4 -5
  213. data/test/dummy/app/models/js_configuration.rb +1 -0
  214. data/test/dummy/app/models/product.rb +3 -2
  215. data/test/dummy/app/models/widget_configuration.rb +1 -0
  216. data/test/dummy/bin/bundle +1 -1
  217. data/test/dummy/bin/rails +1 -1
  218. data/test/dummy/bin/setup +8 -8
  219. data/test/dummy/config/application.rb +4 -3
  220. data/test/dummy/config/boot.rb +2 -2
  221. data/test/dummy/config/database.yml +3 -0
  222. data/test/dummy/config/environment.rb +1 -1
  223. data/test/dummy/config/environments/staging.rb +85 -0
  224. data/test/dummy/config/initializers/disco_app.rb +1 -1
  225. data/test/dummy/config/initializers/omniauth.rb +3 -4
  226. data/test/dummy/config/initializers/session_store.rb +1 -1
  227. data/test/dummy/config/routes.rb +0 -2
  228. data/test/dummy/config/secrets.yml +3 -0
  229. data/test/dummy/db/migrate/20160307182229_create_products.rb +3 -1
  230. data/test/dummy/db/migrate/20160530160739_create_asset_models.rb +3 -1
  231. data/test/dummy/db/migrate/20161105054746_create_carts.rb +2 -1
  232. data/test/dummy/db/schema.rb +179 -152
  233. data/test/dummy/log/development.log +123 -0
  234. data/test/dummy/log/test.log +22884 -0
  235. data/test/dummy/tmp/cache/assets/sprockets/v3.0/-p/-p4kkBudGSkrc-Hs2yVEjJfJGuf9E8MY-5Huo4W9iZ0.cache +3 -0
  236. data/test/dummy/tmp/cache/assets/sprockets/v3.0/02/02ODr719GA9zZyrA_CgJwh5Vg-Pq_dHkMMbUvRIygtA.cache +3 -0
  237. data/test/dummy/tmp/cache/assets/sprockets/v3.0/0y/0yiARCmpEBX_JoExohBEcHFx0vv-nWUcjHbxtQbEA3w.cache +1 -0
  238. data/test/dummy/tmp/cache/assets/sprockets/v3.0/12/12KLSO9fSADQ-vGWrYiIRQqP1yFoPcxxZfCvm6paqnE.cache +1 -0
  239. data/test/dummy/tmp/cache/assets/sprockets/v3.0/1h/1ho8ca9C4lfKF780RN8l2MHAActK0WYWa_5I_LQO_ag.cache +1 -0
  240. data/test/dummy/tmp/cache/assets/sprockets/v3.0/2E/2E5jz5DyydbByixysW06PLr06e_FQdg9TtbY_LxsRo8.cache +0 -0
  241. data/test/dummy/tmp/cache/assets/sprockets/v3.0/2J/2JdcXeYI4Ed1DoLpSzLbKAvxbzMjrdwRoNICGVN45dU.cache +0 -0
  242. data/test/dummy/tmp/cache/assets/sprockets/v3.0/2X/2X74oB94L9QPqDYRPZkVEcbdsec1wp6qB_y7h3qwYp4.cache +1 -0
  243. data/test/dummy/tmp/cache/assets/sprockets/v3.0/32/32y6lFrrvtuqVj8A3uafoeX0iA_l4YhD5PJS1JvQIfk.cache +0 -0
  244. data/test/dummy/tmp/cache/assets/sprockets/v3.0/35/35LlNk3lHMnnozK9qRT4mpTbnAtOnjBpfHIybikbcfo.cache +0 -0
  245. data/test/dummy/tmp/cache/assets/sprockets/v3.0/3X/3Xl5kEo1hpRF6kHX2lvLp2kUaNDYGuAkylPqJsOLKXQ.cache +0 -0
  246. data/test/dummy/tmp/cache/assets/sprockets/v3.0/4H/4HXBYKkHtI3ZmDZncAS7pdUwtVhzmwt8XWQMGH1R5xo.cache +0 -0
  247. data/test/dummy/tmp/cache/assets/sprockets/v3.0/4H/4hR2zE1hAnLGpPIQS2v71qG-jmiWb2SHAbGiQjxijck.cache +1 -0
  248. data/test/dummy/tmp/cache/assets/sprockets/v3.0/4O/4OJh4kuEsZJ7ok8p5Wd0wui5pwAE46AFCurNgp2gSmk.cache +1 -0
  249. data/test/dummy/tmp/cache/assets/sprockets/v3.0/4Q/4Qe1126dQRjtMngpBX8SwgKoZu8tQFMDj6XxRU8h4TM.cache +1 -0
  250. data/test/dummy/tmp/cache/assets/sprockets/v3.0/4a/4aPQ7FUdl3IqfTnkIvvU_TbAQVz9rEuUbGQk4YMlFHc.cache +4 -0
  251. data/test/dummy/tmp/cache/assets/sprockets/v3.0/4t/4t0ZbDDyABeGi5MqrX0f4_dHY4BEtHc_zGRi1rkQRog.cache +3 -0
  252. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5e/5efYNzR4038HZsit1p-T65aXkUBH4ZVleUZb9hEvXIw.cache +1 -0
  253. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5f/5fTS4gj7gRDTvcAIYd46ZVrIJqJxQXrLVHhxzWoSJnw.cache +0 -0
  254. data/test/dummy/tmp/cache/assets/sprockets/v3.0/6B/6B5j5ojbS7-L49BW-pNvcpI-SvSgiwvMtK7cKz9UnVE.cache +1 -0
  255. data/test/dummy/tmp/cache/assets/sprockets/v3.0/87/87o1fQc0-Zza8i-HNr9IqA4HYu8ePoAOkIJKIKf8Z6c.cache +0 -0
  256. data/test/dummy/tmp/cache/assets/sprockets/v3.0/8G/8Gp6gCGqi_pI4TmiSRkdhdWznz8tSvZmez3YdyJLNDk.cache +1 -0
  257. data/test/dummy/tmp/cache/assets/sprockets/v3.0/8Z/8Z6fieaymg-zBK1iKgH2xBNnbfeA8Or1VfihnmwZfDc.cache +1 -0
  258. data/test/dummy/tmp/cache/assets/sprockets/v3.0/95/95puf81N4E8lDxbeI9yL09DueyWMUjfsUJ9IAP5jOOM.cache +1 -0
  259. data/test/dummy/tmp/cache/assets/sprockets/v3.0/9E/9E3lx2-LKkXgLWP5jG38B5uCsGiSeWq2po03Die5KF4.cache +3 -0
  260. data/test/dummy/tmp/cache/assets/sprockets/v3.0/9m/9m2H02fp4A1UDiXojyy9sl9NgiiNhAbWFL99jKLSUXQ.cache +1 -0
  261. data/test/dummy/tmp/cache/assets/sprockets/v3.0/A-/A-NmGmyyn0mjkLyKGGU0KRIZalJ2fZNyOkgZt5e910I.cache +3 -0
  262. data/test/dummy/tmp/cache/assets/sprockets/v3.0/AF/AFq71LdWk8T3oJ3clzVzZV--uw0vgLDhG7eMv-RzXWQ.cache +0 -0
  263. data/test/dummy/tmp/cache/assets/sprockets/v3.0/AV/AVaNyVl3EijOrYMZaI7oNgwVbsBIxZHrTKLar1ze83A.cache +0 -0
  264. data/test/dummy/tmp/cache/assets/sprockets/v3.0/B-/B-Qo2b4ZsaxV28WasrCQxMuvqER0D7WhzdE4ydvu6bs.cache +1 -0
  265. data/test/dummy/tmp/cache/assets/sprockets/v3.0/BC/BCGc2X3UiMM53c7SecA7o8rP8PnnWI-msrib8ngDCzU.cache +1 -0
  266. data/test/dummy/tmp/cache/assets/sprockets/v3.0/B_/B_Zzsw0s5HhMI_CS94zPqXl1CdI5oR2CksO7cRDTQKk.cache +0 -0
  267. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Bk/BkOwynwXRQOTj1eL9WyhTbRj-UqFPIrWaIpShoHs9Ck.cache +1 -0
  268. data/test/dummy/tmp/cache/assets/sprockets/v3.0/CP/CPGMneZZYKfNQIQfykCtq6C_kPvs-Q_5IT7-62sQig8.cache +0 -0
  269. data/test/dummy/tmp/cache/assets/sprockets/v3.0/D4/D4FYk677edDaB59dMMpaLK_laiH2ExaAoNfQ3tckUe0.cache +0 -0
  270. data/test/dummy/tmp/cache/assets/sprockets/v3.0/D9/D9O72M_cglvDAMJDjtzio3B6-aC_mmcbI4mLvvKnBX8.cache +1 -0
  271. data/test/dummy/tmp/cache/assets/sprockets/v3.0/DM/DMgq30X20--UWPvaAZ5Cf4oEvG4tBBHF4gLe5mnePRI.cache +1 -0
  272. data/test/dummy/tmp/cache/assets/sprockets/v3.0/E0/E03lez839JRYKgxWxjIrCnVdXJ26UoZDCSHUmR4ojdc.cache +0 -0
  273. data/test/dummy/tmp/cache/assets/sprockets/v3.0/E4/E4Pb3S8O5ZHVIkRSm6c-VFO-17tIFqQzHVloIC9yVQQ.cache +2 -0
  274. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ep/Eph4FRIXVEgT6ofe0aGn6s-8A-Q0jsyxstY422Btwgk.cache +0 -0
  275. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Eq/Eq6J05FaAYDioPfJRie-I5fIzVt8N8Cc9fFrum3R0kU.cache +2 -0
  276. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ev/EvGs2l1aBK0RXGSw8osKl01fEOHn6RuiWkR55TIZADE.cache +0 -0
  277. data/test/dummy/tmp/cache/assets/sprockets/v3.0/F3/F3sM5VHZOb3PYnt59S-zBWfWtU_HMpihPI61bBdqtPo.cache +0 -0
  278. data/test/dummy/tmp/cache/assets/sprockets/v3.0/FV/FVpKiOBNCAznp4Ya_eMnQ38K-xO3tK46uPBg-mFB4v4.cache +0 -0
  279. data/test/dummy/tmp/cache/assets/sprockets/v3.0/G5/G5aZsL6LP4HC_Of4i2yYsPaOm8dEOLIXkYdZ6tfuYH4.cache +1 -0
  280. data/test/dummy/tmp/cache/assets/sprockets/v3.0/GP/GPc2gCWO8la32JX3fK1ArDYv3QM63WVQ4S0iwpyJinA.cache +1 -0
  281. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Hg/Hgo9RBfSwY8h8vBNKW38aTRYrA2POVwE2v0ZUs4H4iY.cache +1 -0
  282. data/test/dummy/tmp/cache/assets/sprockets/v3.0/I2/I2iRIXHbnG_vgyhptOqXgQHRe8AIPfa34zmkDL06ibY.cache +2 -0
  283. data/test/dummy/tmp/cache/assets/sprockets/v3.0/IT/ITu-bZPOSBI44uFwzG-2bXQvYQvlsjFhIzQtA6FjpzI.cache +0 -0
  284. data/test/dummy/tmp/cache/assets/sprockets/v3.0/IU/IUU7_XlyzslBC48YPBBx35oNruWg9vN906B_uV4GiDg.cache +0 -0
  285. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Jt/JtSpiYSuQ7CjfmgQNb7_FLI2Bls3o7yLZf-2Yn3Tp2U.cache +1 -0
  286. data/test/dummy/tmp/cache/assets/sprockets/v3.0/KA/KA1WZHj-tCh9wJTjQ82C6RW2abPAHfPbczUvt3U0tBA.cache +1 -0
  287. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Kr/KrbYQRjOQilz5PwngxqljeBbo7gnho2oNCzt9xeostM.cache +2 -0
  288. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Kv/KvrosnOxWBhs2jdBY359Jd_PuPgvRxTEhknjpLZI2J4.cache +1 -0
  289. data/test/dummy/tmp/cache/assets/sprockets/v3.0/LB/LBKCbI8U7auhpX6SCBMuQUyESeMLr90SUzMlnB2u9K0.cache +0 -0
  290. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Lx/LxvZGzkKI0YLuIZB1jBioj31ElpU3JOmhzZrQIqu6f4.cache +2 -0
  291. data/test/dummy/tmp/cache/assets/sprockets/v3.0/MA/MAY9X_jK8UHgcT3acJjAPNRR1io9S2E5KXFZjk9BVoc.cache +0 -0
  292. data/test/dummy/tmp/cache/assets/sprockets/v3.0/MA/MAjMl63wcw2lt9F7Fu0Aml-DdcReV0Op4kCwLLkgZzE.cache +1 -0
  293. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Mb/MbUcsjDehlhHnLqP_sU8IKStNYDZEz09Ga5gk4psMZU.cache +1 -0
  294. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Mf/Mfdr1mda4l8eqbsSlL2hylksXaiTeYfwU-fq4ko_F_s.cache +1 -0
  295. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ND/NDwUm11hTOtktv5tkuUYsrSYAA911qwhO2acqloyxas.cache +0 -0
  296. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ND/ndYRNd1Jv1ESobiH7xjHCJXHooPNdUPSxG8OUoCVi40.cache +1 -0
  297. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Nu/NuS-wdnyjTJSg7hUaprtYh_3hQyvNGTTaRSmK0tUNiU.cache +3 -0
  298. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Nz/NzUGztrNqSgb4WfJOviqI6mjmx1g1L9T6V7BdOgZs3A.cache +0 -0
  299. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Oo/Oox1vL8lRd_YME1JHrD8fTh4Osz1njTWieFpIZ0_G2Y.cache +1 -0
  300. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Pj/PjFSX3ELsmK13-CVKc39OnguIcUMb4EbMV6s0lspCps.cache +1 -0
  301. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Qa/Qa6iUyiZsHRjXGz39RPFnBoVYB2YNZJRlihJjDXm1Bk.cache +0 -0
  302. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Qa/qA0PpX9EMQtQoiP0QbK5bYMUX9OkK1OKTIKwGLtqEMw.cache +0 -0
  303. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Qv/Qvrsp8Of-JGCe25QvfmdH--wQL5vGbLtKiKb921jFq4.cache +1 -0
  304. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Qx/QxOtw5pSMh_dcbeU_FmhURV2lEsclOCcFfNrk2EoSRA.cache +0 -0
  305. data/test/dummy/tmp/cache/assets/sprockets/v3.0/RB/RBgpR6mjFySj9-G4E_qadgKjQbF7G_pAA6D_iRDUk1k.cache +0 -0
  306. data/test/dummy/tmp/cache/assets/sprockets/v3.0/RY/RYr7AxgrTd-Qg2KQa84E8ph9qmA7YFrdrVHMRxMxh_w.cache +0 -0
  307. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Re/ReX-_166hRZykFAwmvCQ19NZEbV6Wa82TEZyyIJna4I.cache +3 -0
  308. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Rk/Rk2lt4VSCTBJ_5w3zwlezlAymCnCIrj-u4hkGrphzDM.cache +1 -0
  309. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Rl/RlgTK-oa7AfiImaIV0ABJ7Gfbg0PdFMeQitXJ-wgKA4.cache +1 -0
  310. data/test/dummy/tmp/cache/assets/sprockets/v3.0/SG/SGGTeEpmk20e5GZV4hcfdbmHMbsQgC8C1VhYlrrQ66M.cache +0 -0
  311. data/test/dummy/tmp/cache/assets/sprockets/v3.0/SK/SKaaVqp6uc_kLTIG2y22QaCGc6g3O4GhL8G4LwJJB8s.cache +1 -0
  312. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Sw/SwRQFgc8QgHfYpyQ7yxe3tPOoP2VJ4Gg6hNH1-fS7LQ.cache +0 -0
  313. data/test/dummy/tmp/cache/assets/sprockets/v3.0/TF/TFzMURDWcxBdkePR_mAtaTIrdc4vWlLJuL48b_xiOxQ.cache +0 -0
  314. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ul/Ulgt7E1quzZA4FaG37lmxJCoTzG74eHZg-dpjniHHYw.cache +0 -0
  315. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Vr/Vr3hv8nrf3Q9kTPp7bZK9GzGVXU77Yrd_iW4QjMda08.cache +0 -0
  316. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Wg/WgJ8nC_59fjWlE7iFIGPD94i3QCNLt1kR9gcAFkou_4.cache +1 -0
  317. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Wi/WiufxFw0JHFbFUn_8t_eC06A3pMN-vHT-Bs-bxXLsJk.cache +1 -0
  318. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Wx/WxK5JQ5Syi4DSTgcxH3k0-PfF_g7eeb7qW1z5EEqEkY.cache +1 -0
  319. data/test/dummy/tmp/cache/assets/sprockets/v3.0/XB/XBj30cQH2Bw6KE9wpF6ylqczHNtz1rvailJi85_aXFY.cache +0 -0
  320. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Xf/XfRpHm7iz1vW_wpIEZRO4i4dFQLBLzmdP3UPg1tcf-E.cache +0 -0
  321. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Xt/Xtcw2vyNc82l8ChsSieO0h0kbELj9P2Tw9TxjmttoEw.cache +1 -0
  322. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Y0/Y0IFckg4LNe1fBvLBTvZct2gfX_g_1MpAMoTBU8qfLg.cache +0 -0
  323. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Y0/y0SkzhEQe_b3MQq69A2KH5LjHUB7vPYj6wp4neZzf6Q.cache +1 -0
  324. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Y4/Y4jdKVp7dOOcuMaUutQ1s4NmmLXq47L1LWhyXZXEaLg.cache +3 -0
  325. data/test/dummy/tmp/cache/assets/sprockets/v3.0/YE/YEjjWfxdNXU6i_3BklG7anaVrOdu-5jksfoL9GufaGU.cache +0 -0
  326. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Yi/YitmSGSMIDji4aC0llOHl0AS6taxqjRk6e_SYw-V1Is.cache +1 -0
  327. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Zb/Zbler-n-7XzOneefutPvH2Cu1UsS967fqjldXwVuStU.cache +0 -0
  328. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Zs/Zs5ig01Gu3Y1thnsToaKQbOIFKAQPCQm0HEEec_vblE.cache +1 -0
  329. data/test/dummy/tmp/cache/assets/sprockets/v3.0/_C/_C10TQWkrfsm41Aaav86lCOkEcLdO7fX8yojbphLRbE.cache +1 -0
  330. data/test/dummy/tmp/cache/assets/sprockets/v3.0/_G/_GCN7qhLkwrwMKEGcBZ9ITsu0QC1l9HD9XaViXBlNQM.cache +0 -0
  331. data/test/dummy/tmp/cache/assets/sprockets/v3.0/_H/_HRU4CZPSyJ4PEUvsGMJSiIVZqSkNIvU3PoQGUB4l2I.cache +3 -0
  332. data/test/dummy/tmp/cache/assets/sprockets/v3.0/_T/_TQROPFCUq0STw2BzbGITspAWA8dF_WvVa7aR02nXAE.cache +2 -0
  333. data/test/dummy/tmp/cache/assets/sprockets/v3.0/_d/_dgNuvKh1O-ss5yC3qg8KPo3anB_pzCXJw3sphxrAFI.cache +0 -0
  334. data/test/dummy/tmp/cache/assets/sprockets/v3.0/_p/_pqVJRc7OZRexEiqcsNQKd5ip8aNkUW9mKQc6OpAp8I.cache +0 -0
  335. data/test/dummy/tmp/cache/assets/sprockets/v3.0/a1/a1P7jCwGayzCGMYDX1CYCSvT7-pi0eiRewg9KbC-6mI.cache +2 -0
  336. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ao/aoPwSmt5N3P9MyBoWUSbkg8F3_b0jhvKuZ6GlBbwRw0.cache +1 -0
  337. data/test/dummy/tmp/cache/assets/sprockets/v3.0/au/au5wohs0fb0VW1crV3GXkqZs18247x-hRKniPTdRqRM.cache +3 -0
  338. data/test/dummy/tmp/cache/assets/sprockets/v3.0/bW/bWiegRudr21oJdzrS11Fu6RMJ9hjYELHp5F94RA6zRI.cache +1 -0
  339. data/test/dummy/tmp/cache/assets/sprockets/v3.0/c1/c1tUtq98JfLhITxPjfdj6g0Ys9pCpneLHq6wBa9v4co.cache +1 -0
  340. data/test/dummy/tmp/cache/assets/sprockets/v3.0/cC/cCneJUl-S3YnUyRCXIUSQxORgSrNf3K24tBhWxLceo4.cache +0 -0
  341. data/test/dummy/tmp/cache/assets/sprockets/v3.0/cK/cK54mTNBuCdAdDEaSzhZ43uo00XDN8FDTMcsViGpmUc.cache +0 -0
  342. data/test/dummy/tmp/cache/assets/sprockets/v3.0/cy/cydtDFqB_RwfVSEq7ACddUz8us2dp3h4WtZnAJTukfU.cache +0 -0
  343. data/test/dummy/tmp/cache/assets/sprockets/v3.0/dY/dYKoKcEw2XuaSJKsyIixsGilwIzRPtXACDh0e-w3PAM.cache +1 -0
  344. data/test/dummy/tmp/cache/assets/sprockets/v3.0/eY/eYr7xslMqmPqzIH5i1RCZ-XnPoU9owIbQ-hnrsR9SFk.cache +1 -0
  345. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ec/ecxUdWV-k6NvipoXNVXRmH32mnDSwr-ZeNVGhBlpYQQ.cache +0 -0
  346. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ej/ejTWaTrHa-76kUnlqc-EfP1NfTPMyHyqS00NMupK9WQ.cache +0 -0
  347. data/test/dummy/tmp/cache/assets/sprockets/v3.0/f7/f7tLgf7D2qMZcsHSt8R97kFvH30wBYGkeLz9-8U6uhc.cache +1 -0
  348. data/test/dummy/tmp/cache/assets/sprockets/v3.0/fX/fXmxRq4KBzpEegCEzFlkLnWGxPMakZmprlIYMFbQJ1E.cache +0 -0
  349. data/test/dummy/tmp/cache/assets/sprockets/v3.0/g7/g7UL8J5-FXcqK8YQM_ghdj_iEx4xnApvwAaWbgBV0TY.cache +1 -0
  350. data/test/dummy/tmp/cache/assets/sprockets/v3.0/gV/gVz5L3gA5w0S8o3yZpVZF-mP-TreyN5iepl1RRZ-R-E.cache +0 -0
  351. data/test/dummy/tmp/cache/assets/sprockets/v3.0/hI/hIpGOQMTq1d2_3DlNrPG4Q7MfO1WPpkjtd7RFyBWu3A.cache +1 -0
  352. data/test/dummy/tmp/cache/assets/sprockets/v3.0/hI/hiDKOMo7TGsMf1DyunEb03ce439H742gxAM3mgi6Ihg.cache +0 -0
  353. data/test/dummy/tmp/cache/assets/sprockets/v3.0/iG/iGaY16bCJiW0AwP1GzM9Uwad-mZCe1Q937irWUgiI9c.cache +0 -0
  354. data/test/dummy/tmp/cache/assets/sprockets/v3.0/iy/iyzEFHfDRV_piHvWtrdYZuaKMqScr_j4oPKDNHfsDjU.cache +1 -0
  355. data/test/dummy/tmp/cache/assets/sprockets/v3.0/kn/knb5R_X55aCiFz3vJWuSUSQPM4CHSNnp0iae5UMECcw.cache +1 -0
  356. data/test/dummy/tmp/cache/assets/sprockets/v3.0/lJ/lJBk3thZoWRjF0s__eDJF7w6qLdkFpA4eAbwgxH_Dho.cache +1 -0
  357. data/test/dummy/tmp/cache/assets/sprockets/v3.0/lY/lYQpdxF4JQIu4RN2ECazZRXa2r04cIJxhUIa05qojZE.cache +3 -0
  358. data/test/dummy/tmp/cache/assets/sprockets/v3.0/m4/m4QRh4VcQWkjLezj3he7eCiAI-NzVhXPeLzAAcIlYxU.cache +3 -0
  359. data/test/dummy/tmp/cache/assets/sprockets/v3.0/mH/mHZUE9U2nO5Wpi1_6ZOvKorTK0DB1XAgAy8vCzKwPUE.cache +3 -0
  360. data/test/dummy/tmp/cache/assets/sprockets/v3.0/mM/mMFR0RXDB_d00Q-DWF3raKUOK_pKIoLKWe8sbByIbmA.cache +2 -0
  361. data/test/dummy/tmp/cache/assets/sprockets/v3.0/mj/mjHlIUoMbdf3_s3E3yHmx6cD3XBpNw44VkLuszduuQU.cache +2 -0
  362. data/test/dummy/tmp/cache/assets/sprockets/v3.0/mj/mjVM7LYY8IA7tuNN3xA7teC_8er8vfGYt2yIlZtm9ss.cache +1 -0
  363. data/test/dummy/tmp/cache/assets/sprockets/v3.0/my/myTGA5_heGVdkdReWuRE40AphRvs-JEHfS14DVL5pIk.cache +1 -0
  364. data/test/dummy/tmp/cache/assets/sprockets/v3.0/nb/nbBwrQkAIneOVTkIGBCdsMtZIT4043SIOR6sXJP_LHU.cache +0 -0
  365. data/test/dummy/tmp/cache/assets/sprockets/v3.0/nq/nqJAnHctHKNe0jSpv19MqPf8BB_w495YOe2rzF_ehos.cache +1 -0
  366. data/test/dummy/tmp/cache/assets/sprockets/v3.0/nq/nqj0Mk3m_97LBVDR7MZgIC80X4_mAeL6ZwDdqgtI1Gw.cache +0 -0
  367. data/test/dummy/tmp/cache/assets/sprockets/v3.0/od/odSXqZl0ZH48zGt8AMIRhQkDU-YtstjobbS5e7ZkN3k.cache +0 -0
  368. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pO/pOygnjQeOv1F__tZVlOBgQIns_FPOY0Hg8jD24Q1MzQ.cache +0 -0
  369. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pZ/pZ0SU1EHDUQqCK7f8encuHCG6TMsPQBoRaMFxy5vqfo.cache +1 -0
  370. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pp/ppVvwCOmFUDtfjoiXcUyRCdjSHm90PXKtkb4qnuRXco.cache +3 -0
  371. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pu/puTfP5YER7biq4Y4_EFFbcfDeYmOSuBt6z0CGzwFGkA.cache +2 -0
  372. data/test/dummy/tmp/cache/assets/sprockets/v3.0/q1/q1F3pWmX7ZJXbKtQUuNQE2PWTRGmvfAySjo0yHBS_BM.cache +1 -0
  373. data/test/dummy/tmp/cache/assets/sprockets/v3.0/q8/q8rvNJwHhh0RwP_ggTBQX15sVQfAGmHVkhopI3IPsHY.cache +0 -0
  374. data/test/dummy/tmp/cache/assets/sprockets/v3.0/q9/q9Mvo1FFlvxT_LCt7H3xYwBY1V5h3Jpe0eEXH8fv5Wk.cache +1 -0
  375. data/test/dummy/tmp/cache/assets/sprockets/v3.0/qG/qGfHn3hSyl2R1i-xwZDvumLbhV-cFIv5USU0_1iehb4.cache +1 -0
  376. data/test/dummy/tmp/cache/assets/sprockets/v3.0/qS/qSUOLK2mlX6Qg4pb39vYusg3MMB-5KqC4PqOt3qqU_I.cache +0 -0
  377. data/test/dummy/tmp/cache/assets/sprockets/v3.0/qZ/qZ7PeULj1cXaHw1RbEoymDg9vVEWoqR7b2tfe6Bjc-g.cache +1 -0
  378. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ql/qldoyykCYdfXs4qvYwGJiKYSq-r0R1Hlw6cjY8IUfmk.cache +3 -0
  379. data/test/dummy/tmp/cache/assets/sprockets/v3.0/s9/s91U__cBvKPCirRM_cTGjn2d8Iv3KUJ2NbC6HeITxbg.cache +0 -0
  380. data/test/dummy/tmp/cache/assets/sprockets/v3.0/sI/sINrJvpYJWwxFKLJbhUC7OAf7ZuyUP888wzWFOlBPts.cache +3 -0
  381. data/test/dummy/tmp/cache/assets/sprockets/v3.0/sI/sIyfH9Z6L3jrjvuKCFI7EqiQOZ2AETT6OvpnumLpjQg.cache +1 -0
  382. data/test/dummy/tmp/cache/assets/sprockets/v3.0/sU/sU13DKNwa_RkHnSkgjrhcBWQed7kETAwwikJRsAU00M.cache +1 -0
  383. data/test/dummy/tmp/cache/assets/sprockets/v3.0/sq/sqx5Hs0Pydu-MUCvGvLJVo9B2Q3rFkn88DuIz9KSkaU.cache +1 -0
  384. data/test/dummy/tmp/cache/assets/sprockets/v3.0/tp/tpDl_cHg-S7_NzWixr_IxfubDy8a3sRY9mOfB_eDu_0.cache +0 -0
  385. data/test/dummy/tmp/cache/assets/sprockets/v3.0/tt/tthgO-QyL3rkOmOxkriE3s0lD3m_en6g7IVBmP6WfpQ.cache +1 -0
  386. data/test/dummy/tmp/cache/assets/sprockets/v3.0/tu/tuvygi0c8-7HYCnG21mYtnMbRq3byGoC-v0EPr_rcqw.cache +1 -0
  387. data/test/dummy/tmp/cache/assets/sprockets/v3.0/u7/u7Ba9DdA5Y5nYCATAuCiIkwdzV8uFn2mIAz6uIKQGCY.cache +1 -0
  388. data/test/dummy/tmp/cache/assets/sprockets/v3.0/u9/u9kCUfXtoYIqW4g4MTByGD589fmczyYmfBSV1aBwKlA.cache +1 -0
  389. data/test/dummy/tmp/cache/assets/sprockets/v3.0/vo/vo2bQsrDyQHltM8J3UVYBos-ex4ksUlyS_JaAXL9gp8.cache +0 -0
  390. data/test/dummy/tmp/cache/assets/sprockets/v3.0/wN/wNuzOUQkHcNtINLMu5i-oArMVgYINdApTU3CTGrBcr0.cache +1 -0
  391. data/test/dummy/tmp/cache/assets/sprockets/v3.0/xH/xHIb5G7OYHTA8bRoeHgv0B_-ttn9qrt7X8tNzWmBOSw.cache +0 -0
  392. data/test/dummy/tmp/cache/assets/sprockets/v3.0/yG/yGybriOHUct9EJuL4y_xiTsDmXYhzyhtdyjMl_bdnyA.cache +0 -0
  393. data/test/dummy/tmp/cache/assets/sprockets/v3.0/yH/yHWDEeVRq__H83jsasoRVfR13AGZqz3-ljrem37eYhA.cache +1 -0
  394. data/test/dummy/tmp/cache/assets/sprockets/v3.0/yJ/yJOgszuKdJlo777tz6syyQBm-5U9m92DdtWG80FyLrk.cache +1 -0
  395. data/test/dummy/tmp/cache/assets/sprockets/v3.0/zN/zN6nRw3aNJhIaKnykNJFXsCpDZNJhoeGEh6OC0YmBEQ.cache +0 -0
  396. data/test/dummy/tmp/cache/assets/sprockets/v3.0/zZ/zZz-dhRhZqpFP0QbFY4EnkgUw5okSYV61DC3u-Uo_Lg.cache +1 -0
  397. data/test/dummy/tmp/cache/assets/sprockets/v3.0/zy/zyV8aFlgWhLDl1dtI6PHd8CiddDhYL9jpZTc6f00L2Y.cache +0 -0
  398. data/test/integration/synchronises_test.rb +2 -1
  399. data/test/jobs/disco_app/app_installed_job_test.rb +27 -8
  400. data/test/jobs/disco_app/app_uninstalled_job_test.rb +5 -2
  401. data/test/jobs/disco_app/send_subscription_job_test.rb +3 -2
  402. data/test/jobs/disco_app/synchronise_carrier_service_job_test.rb +1 -0
  403. data/test/jobs/disco_app/synchronise_users_job_test.rb +1 -0
  404. data/test/jobs/disco_app/synchronise_webhooks_job_test.rb +31 -14
  405. data/test/models/disco_app/can_be_liquified_test.rb +3 -1
  406. data/test/models/disco_app/has_metafields_test.rb +37 -18
  407. data/test/models/disco_app/renders_assets_test.rb +2 -1
  408. data/test/models/disco_app/session_test.rb +2 -2
  409. data/test/services/disco_app/charges_service_test.rb +7 -8
  410. data/test/services/disco_app/flow/create_action_test.rb +51 -0
  411. data/test/services/disco_app/flow/create_trigger_test.rb +56 -0
  412. data/test/services/disco_app/flow/process_action_test.rb +68 -0
  413. data/test/services/disco_app/flow/process_trigger_test.rb +61 -0
  414. data/test/services/disco_app/subscription_service_test.rb +3 -2
  415. data/test/support/test_file_fixtures.rb +2 -2
  416. data/test/support/test_shopify_api.rb +1 -1
  417. data/test/test_helper.rb +7 -7
  418. data/test/vcr/flow_trigger_invalid_title.yml +35 -0
  419. data/test/vcr/flow_trigger_valid.yml +38 -0
  420. metadata +732 -250
  421. data/app/clients/disco_app/rollbar_client.rb +0 -53
  422. data/app/clients/disco_app/rollbar_client_error.rb +0 -2
  423. data/lib/generators/disco_app/USAGE +0 -5
  424. data/lib/generators/disco_app/disco_app_generator.rb +0 -236
  425. data/lib/generators/disco_app/templates/config/newrelic.yml +0 -26
  426. data/lib/generators/disco_app/templates/initializers/rollbar.rb +0 -23
  427. data/lib/generators/disco_app/templates/initializers/session_store.rb +0 -2
  428. data/lib/generators/disco_app/templates/root/.codeclimate.yml +0 -7
  429. data/lib/tasks/rollbar.rake +0 -24
@@ -2,6 +2,7 @@ require 'render_anywhere'
2
2
  require 'uglifier'
3
3
 
4
4
  module DiscoApp::Concerns::RendersAssets
5
+
5
6
  extend ActiveSupport::Concern
6
7
 
7
8
  included do
@@ -10,7 +11,6 @@ module DiscoApp::Concerns::RendersAssets
10
11
  end
11
12
 
12
13
  class_methods do
13
-
14
14
  # Ruby "macro" that allows the definition of a number of Shopify assets that
15
15
  # should be rendered and uploaded when certain attributes on the including
16
16
  # class change. This assumes that the including class (1) is an ActiveRecord
@@ -67,10 +67,9 @@ module DiscoApp::Concerns::RendersAssets
67
67
  assets: nil,
68
68
  triggered_by: nil,
69
69
  script_tags: nil,
70
- minify: Rails.env.production?
70
+ minify: Rails.env.production? || Rails.env.staging?
71
71
  }
72
72
  end
73
-
74
73
  end
75
74
 
76
75
  # Callback, triggered after a model save. Iterates through each asset group
@@ -78,9 +77,7 @@ module DiscoApp::Concerns::RendersAssets
78
77
  # attributes are found in the asset group's triggered_by list.
79
78
  def queue_render_asset_group_job
80
79
  renderable_asset_groups.each do |asset_group, options|
81
- unless (previous_changes.keys & options[:triggered_by]).empty?
82
- DiscoApp::RenderAssetGroupJob.perform_later(shop, self, asset_group.to_s)
83
- end
80
+ DiscoApp::RenderAssetGroupJob.perform_later(shop, self, asset_group.to_s) unless (previous_changes.keys & options[:triggered_by]).empty?
84
81
  end
85
82
  end
86
83
 
@@ -97,26 +94,22 @@ module DiscoApp::Concerns::RendersAssets
97
94
 
98
95
  options[:assets].each do |asset|
99
96
  # Create/replace the asset via the Shopify API.
100
- shopify_asset = shop.with_api_context {
97
+ shopify_asset = shop.with_api_context do
101
98
  ShopifyAPI::Asset.create(
102
99
  key: asset,
103
100
  value: render_asset_group_asset(asset, public_urls, options)
104
101
  )
105
- }
102
+ end
106
103
 
107
104
  # Store the public URL to this asset, so that we're able to use it in
108
105
  # subsequent template renders. Adds a .css suffix to .scss assets, so that
109
106
  # we use the Shopify-compiled version of any SCSS stylesheets.
110
- if shopify_asset.public_url.present?
111
- public_urls[asset] = shopify_asset.public_url.gsub(/\.scss\?/, '.scss.css?')
112
- end
107
+ public_urls[asset] = shopify_asset.public_url.gsub(/\.scss\?/, '.scss.css?') if shopify_asset.public_url.present?
113
108
  end
114
109
 
115
110
  # If we specified the creation of any script tags based on newly rendered
116
111
  # assets, do that now.
117
- unless options[:script_tags].empty?
118
- render_asset_script_tags(options, public_urls)
119
- end
112
+ render_asset_script_tags(options, public_urls) unless options[:script_tags].empty?
120
113
  end
121
114
 
122
115
  private
@@ -141,7 +134,7 @@ module DiscoApp::Concerns::RendersAssets
141
134
 
142
135
  # Return true if the given asset should be minified with Uglifier.
143
136
  def should_be_minified?(asset, options)
144
- asset.to_s.end_with?('.js') and options[:minify]
137
+ asset.to_s.end_with?('.js') && options[:minify]
145
138
  end
146
139
 
147
140
  def render_asset_renderer
@@ -157,9 +150,12 @@ module DiscoApp::Concerns::RendersAssets
157
150
  # Iterate each script tag for which we have a known public URL and create
158
151
  # or update the corresponding script tag resource.
159
152
  public_urls.slice(*options[:script_tags]).each do |asset, public_url|
160
- script_tag = current_script_tags.find(lambda { ShopifyAPI::ScriptTag.new(event: 'onload') }) { |script_tag| script_tag.src.include?("#{asset}?") }
161
- script_tag.src = public_url
162
- shop.with_api_context { script_tag.save }
153
+ generate_new_script_tag = -> { ShopifyAPI::ScriptTag.new(event: 'onload') }
154
+
155
+ current_script_tags
156
+ .find(generate_new_script_tag) { |script_tag| script_tag.src.include?("#{asset}?") }
157
+ .tap { |script_tag| script_tag.src = public_url }
158
+ .yield_self { |script_tag| shop.with_api_context { script_tag.save } }
163
159
  end
164
160
  end
165
161
 
@@ -1,4 +1,5 @@
1
1
  module DiscoApp::Concerns::Shop
2
+
2
3
  extend ActiveSupport::Concern
3
4
 
4
5
  included do
@@ -6,15 +7,19 @@ module DiscoApp::Concerns::Shop
6
7
  include ActionView::Helpers::DateHelper
7
8
 
8
9
  # Define relationships to plans and subscriptions.
9
- has_many :subscriptions
10
+ has_many :subscriptions, dependent: :restrict_with_exception
10
11
  has_many :plans, through: :subscriptions
11
12
 
12
13
  # Define relationship to users.
13
- has_many :users
14
+ has_many :users, dependent: :restrict_with_exception
14
15
 
15
16
  # Define relationship to sessions.
16
17
  has_many :sessions, class_name: 'DiscoApp::Session', dependent: :destroy
17
18
 
19
+ # Define relationship to Flow actions and triggers.
20
+ has_many :flow_actions, class_name: 'DiscoApp::Flow::Action', dependent: :destroy
21
+ has_many :flow_triggers, class_name: 'DiscoApp::Flow::Trigger', dependent: :destroy
22
+
18
23
  # Define possible installation statuses as an enum.
19
24
  enum status: {
20
25
  never_installed: 0,
@@ -27,7 +32,7 @@ module DiscoApp::Concerns::Shop
27
32
  }
28
33
 
29
34
  # Define some useful scopes.
30
- scope :status, -> (status) { where status: status }
35
+ scope :status, ->(status) { where status: status }
31
36
  scope :installed, -> { where status: statuses[:installed] }
32
37
  scope :has_active_shopify_plan, -> { where.not(plan_name: [:cancelled, :frozen, :fraudulent]) }
33
38
  scope :shopify_plus, -> { where(plan_name: :shopify_plus) }
@@ -73,11 +78,6 @@ module DiscoApp::Concerns::Shop
73
78
  "https://#{shopify_domain}/admin"
74
79
  end
75
80
 
76
- # Convenience method to get the email of the shop's admin, to display in Rollbar.
77
- def email
78
- data[:email]
79
- end
80
-
81
81
  def installed_duration
82
82
  distance_of_time_in_words_to_now(created_at.time)
83
83
  end
@@ -87,8 +87,8 @@ module DiscoApp::Concerns::Shop
87
87
  def time_zone
88
88
  @time_zone ||= begin
89
89
  Time.find_zone!(data[:timezone].to_s.gsub(/^\(.+\)\s/, ''))
90
- rescue ArgumentError
91
- Time.zone
90
+ rescue ArgumentError
91
+ Time.zone
92
92
  end
93
93
  end
94
94
 
@@ -100,14 +100,13 @@ module DiscoApp::Concerns::Shop
100
100
 
101
101
  # Return an instance of the Disco API client.
102
102
  def disco_api_client
103
- @api_client ||= DiscoApp::ApiClient.new(self, ENV['DISCO_API_URL'])
103
+ @disco_api_client ||= DiscoApp::ApiClient.new(self, ENV['DISCO_API_URL'])
104
104
  end
105
105
 
106
106
  # Override the "read" data attribute to allow indifferent access.
107
107
  def data
108
108
  read_attribute(:data).with_indifferent_access
109
109
  end
110
-
111
110
  end
112
111
 
113
112
  end
@@ -1,14 +1,13 @@
1
1
  module DiscoApp::Concerns::Source
2
+
2
3
  extend ActiveSupport::Concern
3
4
 
4
5
  included do
5
-
6
- has_many :subscriptions
6
+ has_many :subscriptions, dependent: :restrict_with_exception
7
7
  has_many :shops, through: :subscriptions
8
8
 
9
9
  validates_presence_of :source
10
10
  validates_presence_of :name
11
-
12
11
  end
13
12
 
14
13
  end
@@ -1,8 +1,8 @@
1
1
  module DiscoApp::Concerns::Subscription
2
+
2
3
  extend ActiveSupport::Concern
3
4
 
4
5
  included do
5
-
6
6
  belongs_to :shop
7
7
  belongs_to :plan
8
8
  belongs_to :plan_code, optional: true
@@ -23,12 +23,11 @@ module DiscoApp::Concerns::Subscription
23
23
  scope :current, -> { where status: [statuses[:trial], statuses[:active]] }
24
24
 
25
25
  after_commit :cancel_charge
26
-
27
26
  end
28
27
 
29
28
  # Only require an active charge if the amount to be charged is > 0.
30
29
  def requires_active_charge?
31
- amount > 0
30
+ amount.positive?
32
31
  end
33
32
 
34
33
  # Convenience method to check if this subscription has an active charge.
@@ -67,6 +66,7 @@ module DiscoApp::Concerns::Subscription
67
66
  def cancel_charge
68
67
  return if (previous_changes.keys & ['amount', 'trial_period_days']).empty?
69
68
  return unless active_charge?
69
+
70
70
  active_charge.cancelled!
71
71
  end
72
72
 
@@ -1,31 +1,29 @@
1
1
  module DiscoApp::Concerns::Synchronises
2
+
2
3
  extend ActiveSupport::Concern
3
4
 
4
5
  class_methods do
5
-
6
6
  # Define the number of resources per page to fetch.
7
7
  SYNCHRONISES_PAGE_LIMIT = 250
8
8
 
9
- def should_synchronise?(shop, data)
9
+ def should_synchronise?(_shop, _data)
10
10
  true
11
11
  end
12
12
 
13
- def synchronise_by(shop, data)
13
+ def synchronise_by(_shop, data)
14
14
  { id: data[:id] }
15
15
  end
16
16
 
17
17
  def synchronise(shop, data)
18
- if data.is_a?(ShopifyAPI::Base)
19
- data = ActiveSupport::JSON.decode(data.to_json)
20
- end
18
+ data = JSON.parse(data.to_json) if data.is_a?(ShopifyAPI::Base)
21
19
  data = data.with_indifferent_access
22
20
 
23
21
  return unless should_synchronise?(shop, data)
24
22
 
25
23
  begin
26
- instance = self.find_or_create_by!(self.synchronise_by(shop, data)) do |instance|
27
- instance.shop = shop
28
- instance.data = data
24
+ instance = find_or_create_by!(synchronise_by(shop, data)) do |new_instance|
25
+ new_instance.shop = shop
26
+ new_instance.data = data
29
27
  end
30
28
  rescue ActiveRecord::RecordNotUnique, PG::UniqueViolation
31
29
  retry
@@ -36,7 +34,7 @@ module DiscoApp::Concerns::Synchronises
36
34
  instance
37
35
  end
38
36
 
39
- def should_synchronise_deletion?(shop, data)
37
+ def should_synchronise_deletion?(_shop, _data)
40
38
  true
41
39
  end
42
40
 
@@ -45,26 +43,23 @@ module DiscoApp::Concerns::Synchronises
45
43
 
46
44
  return unless should_synchronise_deletion?(shop, data)
47
45
 
48
- self.where(shop: shop, id: data[:id]).destroy_all
46
+ where(shop: shop, id: data[:id]).destroy_all
49
47
  end
50
48
 
51
49
  def synchronise_all(shop, params = {})
52
50
  resource_count = shop.with_api_context { self::SHOPIFY_API_CLASS.count(params) }
53
51
 
54
52
  (1..(resource_count / SYNCHRONISES_PAGE_LIMIT.to_f).ceil).each do |page|
55
- DiscoApp::SynchroniseResourcesJob.perform_later(shop, self.name, params.merge(page: page, limit: SYNCHRONISES_PAGE_LIMIT))
53
+ DiscoApp::SynchroniseResourcesJob.perform_later(shop, name, params.merge(page: page, limit: SYNCHRONISES_PAGE_LIMIT))
56
54
  end
57
55
  end
58
-
59
56
  end
60
57
 
61
58
  included do
62
-
63
59
  # Override the "read" data attribute to allow indifferent access.
64
60
  def data
65
61
  read_attribute(:data).with_indifferent_access
66
62
  end
67
-
68
63
  end
69
64
 
70
65
  end
@@ -1,4 +1,5 @@
1
1
  module DiscoApp::Concerns::Taggable
2
+
2
3
  extend ActiveSupport::Concern
3
4
 
4
5
  def tags
@@ -1,11 +1,12 @@
1
1
  module DiscoApp::Concerns::User
2
+
2
3
  extend ActiveSupport::Concern
3
4
 
4
5
  included do
5
6
  belongs_to :shop
6
7
 
7
8
  def self.create_user(shopify_user, shop)
8
- user = self.find_or_create_by!(id: shopify_user.id, shop: shop)
9
+ user = find_or_create_by!(id: shopify_user.id, shop: shop)
9
10
  user.update(
10
11
  first_name: shopify_user.first_name || '',
11
12
  last_name: shopify_user.last_name || '',
@@ -15,6 +16,6 @@ module DiscoApp::Concerns::User
15
16
  rescue ActiveRecord::RecordNotUnique, PG::UniqueViolation
16
17
  retry
17
18
  end
18
-
19
19
  end
20
+
20
21
  end
@@ -0,0 +1,9 @@
1
+ module DiscoApp
2
+ module Flow
3
+ class Action < ApplicationRecord
4
+
5
+ include DiscoApp::Flow::Concerns::Action
6
+
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,27 @@
1
+ module DiscoApp
2
+ module Flow
3
+ module Concerns
4
+ module Action
5
+
6
+ extend ActiveSupport::Concern
7
+
8
+ included do
9
+ belongs_to :shop
10
+
11
+ self.table_name = :disco_app_flow_actions
12
+
13
+ enum status: {
14
+ pending: 0,
15
+ succeeded: 1,
16
+ failed: 2
17
+ }
18
+
19
+ def properties
20
+ read_attribute(:properties).with_indifferent_access
21
+ end
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ module DiscoApp
2
+ module Flow
3
+ module Concerns
4
+ module Trigger
5
+
6
+ extend ActiveSupport::Concern
7
+
8
+ included do
9
+ belongs_to :shop
10
+
11
+ self.table_name = :disco_app_flow_triggers
12
+
13
+ enum status: {
14
+ pending: 0,
15
+ succeeded: 1,
16
+ failed: 2
17
+ }
18
+
19
+ def properties
20
+ read_attribute(:properties).with_indifferent_access
21
+ end
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,9 @@
1
+ module DiscoApp
2
+ module Flow
3
+ class Trigger < ApplicationRecord
4
+
5
+ include DiscoApp::Flow::Concerns::Trigger
6
+
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,5 @@
1
1
  class DiscoApp::Plan < ApplicationRecord
2
+
2
3
  include DiscoApp::Concerns::Plan
4
+
3
5
  end
@@ -1,3 +1,5 @@
1
1
  class DiscoApp::PlanCode < ApplicationRecord
2
+
2
3
  include DiscoApp::Concerns::PlanCode
4
+
3
5
  end
@@ -1,5 +1,6 @@
1
1
  module DiscoApp
2
2
  class SessionStorage
3
+
3
4
  def self.store(session)
4
5
  shop = Shop.find_or_initialize_by(shopify_domain: session.url)
5
6
  shop.shopify_token = session.token
@@ -9,10 +10,12 @@ module DiscoApp
9
10
 
10
11
  def self.retrieve(id)
11
12
  return unless id
13
+
12
14
  shop = Shop.find(id)
13
15
  ShopifyAPI::Session.new(shop.shopify_domain, shop.shopify_token)
14
16
  rescue ActiveRecord::RecordNotFound
15
17
  nil
16
18
  end
19
+
17
20
  end
18
21
  end
@@ -1,3 +1,5 @@
1
1
  class DiscoApp::Shop < ApplicationRecord
2
+
2
3
  include DiscoApp::Concerns::Shop
4
+
3
5
  end
@@ -1,3 +1,5 @@
1
1
  class DiscoApp::Source < ApplicationRecord
2
+
2
3
  include DiscoApp::Concerns::Source
4
+
3
5
  end
@@ -1,3 +1,5 @@
1
1
  class DiscoApp::Subscription < ApplicationRecord
2
+
2
3
  include DiscoApp::Concerns::Subscription
4
+
3
5
  end
@@ -1,3 +1,5 @@
1
1
  class DiscoApp::User < ApplicationRecord
2
+
2
3
  include DiscoApp::Concerns::User
4
+
3
5
  end
@@ -1,10 +1,10 @@
1
1
  require 'jsonapi/resource'
2
2
 
3
3
  module DiscoApp::Admin::Resources::Concerns::ShopResource
4
+
4
5
  extend ActiveSupport::Concern
5
6
 
6
7
  included do
7
-
8
8
  attributes :domain, :status, :created_at
9
9
  attributes :email, :country_name, :currency, :plan_display_name
10
10
  attributes :current_subscription_id, :current_subscription_display_amount, :current_subscription_display_plan, :current_subscription_display_plan_code, :current_subscription_source
@@ -15,33 +15,33 @@ module DiscoApp::Admin::Resources::Concerns::ShopResource
15
15
  filters :query, :status
16
16
 
17
17
  # Adjust the base records method to ensure only models for the authenticated domain are retrieved.
18
- def self.records(options = {})
18
+ def self.records(_options = {})
19
19
  records = DiscoApp::Shop.order(created_at: :desc)
20
20
  records
21
21
  end
22
22
 
23
23
  # Apply filters.
24
- def self.apply_filter(records, filter, value, options)
24
+ def self.apply_filter(records, filter, value, _options)
25
25
  return records if value.blank?
26
26
 
27
27
  # Perform appropriate filtering.
28
28
  case filter
29
- when :query
30
- return records.where('name LIKE ? OR shopify_domain LIKE ? OR domain LIKE ?', "%#{value.first}%", "%#{value.first}%", "%#{value.first}%")
31
- when :status
32
- return records.where(status: value.map { |v| DiscoApp::Shop.statuses[v.to_sym] } )
33
- else
34
- return super(records, filter, value)
29
+ when :query
30
+ return records.where('name LIKE ? OR shopify_domain LIKE ? OR domain LIKE ?', "%#{value.first}%", "%#{value.first}%", "%#{value.first}%")
31
+ when :status
32
+ return records.where(status: value.map { |v| DiscoApp::Shop.statuses[v.to_sym] })
33
+ else
34
+ return super(records, filter, value)
35
35
  end
36
36
  end
37
37
 
38
38
  # Don't allow the update of any fields via the API.
39
- def self.updatable_fields(context)
39
+ def self.updatable_fields(_context)
40
40
  []
41
41
  end
42
42
 
43
43
  # Don't allow the creation of any fields via the API.
44
- def self.creatable_fields(context)
44
+ def self.creatable_fields(_context)
45
45
  []
46
46
  end
47
47
 
@@ -62,9 +62,7 @@ module DiscoApp::Admin::Resources::Concerns::ShopResource
62
62
  end
63
63
 
64
64
  def current_subscription_id
65
- if @model.current_subscription?
66
- @model.current_subscription.id
67
- end
65
+ @model.current_subscription.id if @model.current_subscription?
68
66
  end
69
67
 
70
68
  def current_subscription_display_amount
@@ -94,7 +92,6 @@ module DiscoApp::Admin::Resources::Concerns::ShopResource
94
92
  '-'
95
93
  end
96
94
  end
97
-
98
95
  end
99
96
 
100
97
  end
@@ -1,4 +1,5 @@
1
1
  class DiscoApp::Admin::Resources::ShopResource < JSONAPI::Resource
2
+
2
3
  include DiscoApp::Admin::Resources::Concerns::ShopResource
3
4
 
4
5
  end
@@ -2,13 +2,13 @@ class DiscoApp::CarrierRequestService
2
2
 
3
3
  # Return true iff the provided hmac_to_verify matches that calculated from the
4
4
  # given data and secret.
5
- def self.is_valid_hmac?(body, secret, hmac_to_verify)
6
- ActiveSupport::SecurityUtils.secure_compare(self.calculated_hmac(body, secret), hmac_to_verify.to_s)
5
+ def self.valid_hmac?(body, secret, hmac_to_verify)
6
+ ActiveSupport::SecurityUtils.secure_compare(calculated_hmac(body, secret), hmac_to_verify.to_s)
7
7
  end
8
8
 
9
9
  # Calculate the HMAC for the given data and secret.
10
10
  def self.calculated_hmac(body, secret)
11
- digest = OpenSSL::Digest.new('sha256')
11
+ digest = OpenSSL::Digest.new('sha256')
12
12
  Base64.encode64(OpenSSL::HMAC.digest(digest, secret, body)).strip
13
13
  end
14
14
 
@@ -6,24 +6,22 @@ class DiscoApp::ChargesService
6
6
  # Create the charge object locally first.
7
7
  charge = subscription.charge_class.create!(
8
8
  shop: shop,
9
- subscription: subscription,
9
+ subscription: subscription
10
10
  )
11
11
 
12
12
  # Create the charge object on Shopify.
13
- shopify_charge = shop.with_api_context {
13
+ shopify_charge = shop.with_api_context do
14
14
  subscription.shopify_charge_class.create(
15
15
  name: subscription.plan.name,
16
- price: '%.2f' % (subscription.amount.to_f / 100.0),
16
+ price: format('%.2f', (subscription.amount.to_f / 100.0)),
17
17
  trial_days: subscription.plan.has_trial? ? subscription.trial_period_days : nil,
18
18
  return_url: charge.activate_url,
19
19
  test: !DiscoApp.configuration.real_charges?
20
20
  )
21
- }
21
+ end
22
22
 
23
23
  # If we couldn't create the charge on Shopify, return nil.
24
- if shopify_charge.nil?
25
- return nil
26
- end
24
+ return nil if shopify_charge.nil?
27
25
 
28
26
  # Update the local record of the charge from Shopify's created charge, then
29
27
  # return it.
@@ -37,45 +35,39 @@ class DiscoApp::ChargesService
37
35
  # Attempt to activate the given Shopify charge for the given Shop using the
38
36
  # Shopify API. Returns true on successful activation, false otherwise.
39
37
  def self.activate(shop, charge)
40
- begin
41
- # Start by fetching the Shopify charge to check that it was accepted.
42
- shopify_charge = shop.with_api_context {
43
- charge.subscription.shopify_charge_class.find(charge.shopify_id)
44
- }
38
+ # Start by fetching the Shopify charge to check that it was accepted.
39
+ shopify_charge = shop.with_api_context do
40
+ charge.subscription.shopify_charge_class.find(charge.shopify_id)
41
+ end
45
42
 
46
- # Update the status of the local charge based on the Shopify charge.
47
- charge.send("#{shopify_charge.status}!") if charge.respond_to? "#{shopify_charge.status}!"
43
+ # Update the status of the local charge based on the Shopify charge.
44
+ charge.send("#{shopify_charge.status}!") if charge.respond_to? "#{shopify_charge.status}!"
48
45
 
49
- # If the charge wasn't accepted, fail and return.
50
- return false unless charge.accepted?
46
+ # If the charge wasn't accepted, fail and return.
47
+ return false unless charge.accepted?
51
48
 
52
- # If the charge was indeed accepted, activate it via Shopify.
53
- charge.shop.with_api_context {
54
- shopify_charge.activate
55
- }
49
+ # If the charge was indeed accepted, activate it via Shopify.
50
+ charge.shop.with_api_context do
51
+ shopify_charge.activate
52
+ end
56
53
 
57
- # If the charge was recurring, make sure that all other local recurring
58
- # charges are marked inactive.
59
- if charge.recurring?
60
- self.cancel_recurring_charges(shop, charge)
61
- end
54
+ # If the charge was recurring, make sure that all other local recurring
55
+ # charges are marked inactive.
56
+ cancel_recurring_charges(shop, charge) if charge.recurring?
62
57
 
63
- charge.active!
58
+ charge.active!
64
59
 
65
- true
66
- rescue
67
- false
68
- end
60
+ true
61
+ rescue StandardError
62
+ false
69
63
  end
70
64
 
71
65
  # Cancel all recurring charges for the given shop. If the optional charge
72
66
  # parameter is given, it will be excluded from the cancellation.
73
67
  def self.cancel_recurring_charges(shop, charge = nil)
74
68
  charges = DiscoApp::RecurringApplicationCharge.where(shop: shop)
75
- if charge.present?
76
- charges = charges.where.not(id: charge)
77
- end
78
- charges.update_all(status: DiscoApp::RecurringApplicationCharge.statuses[:cancelled])
69
+ charges = charges.where.not(id: charge) if charge.present?
70
+ charges.update_all(status: DiscoApp::RecurringApplicationCharge.statuses[:cancelled]) # rubocop:disable Rails/SkipsModelValidations
79
71
  end
80
72
 
81
73
  end