jinda 0.6.1 → 0.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/generators/jinda/config_generator.rb +7 -0
  4. data/lib/generators/jinda/install_generator.rb +45 -42
  5. data/lib/generators/jinda/templates/Dockerfile +24 -0
  6. data/lib/generators/jinda/templates/app/assets/javascripts/application.js +1 -10
  7. data/lib/generators/jinda/templates/app/assets/stylesheets/application.css.scss +1 -20
  8. data/lib/generators/jinda/templates/app/controllers/jinda_org/articles_controller.rb +5 -3
  9. data/lib/generators/jinda/templates/app/controllers/jinda_org/comments_controller.rb +19 -7
  10. data/lib/generators/jinda/templates/app/jinda/index.mm +22 -19
  11. data/lib/generators/jinda/templates/app/models/comment.rb +5 -3
  12. data/lib/generators/jinda/templates/app/views/articles/show.html.haml +2 -1
  13. data/lib/generators/jinda/templates/config/mongoid.yml-docker +182 -0
  14. data/lib/generators/jinda/templates/config/mongoid.yml-localhost +182 -0
  15. data/lib/generators/jinda/templates/docker-compose.yml +16 -0
  16. data/lib/generators/jinda/templates/entrypoint.sh +12 -0
  17. data/lib/jinda.rb +2 -1
  18. data/lib/jinda/date_helpers.rb +109 -0
  19. data/lib/jinda/{gemhelpers.rb → gem_helpers.rb} +0 -1
  20. data/lib/jinda/gen_class.rb +13 -0
  21. data/lib/jinda/gen_controller.rb +10 -0
  22. data/lib/jinda/gen_freemind.rb +33 -0
  23. data/lib/jinda/gen_helpers.rb +141 -0
  24. data/lib/jinda/gen_models.rb +137 -0
  25. data/lib/jinda/gen_runseq.rb +71 -0
  26. data/lib/jinda/gen_services.rb +90 -0
  27. data/lib/jinda/gen_xmain.rb +38 -0
  28. data/lib/jinda/get_app.rb +34 -0
  29. data/lib/jinda/helpers.rb +17 -995
  30. data/lib/jinda/init_vars.rb +36 -0
  31. data/lib/jinda/rake_views.rb +59 -0
  32. data/lib/jinda/refresh.rb +67 -0
  33. data/lib/jinda/themes.rb +163 -0
  34. data/lib/jinda/version.rb +1 -1
  35. data/test/dummy/Rakefile +6 -0
  36. data/test/dummy/app/assets/config/manifest.js +3 -0
  37. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  38. data/test/dummy/app/channels/application_cable/channel.rb +4 -0
  39. data/test/dummy/app/channels/application_cable/connection.rb +4 -0
  40. data/test/dummy/app/controllers/application_controller.rb +2 -0
  41. data/test/dummy/app/helpers/application_helper.rb +2 -0
  42. data/test/dummy/app/javascript/packs/application.js +15 -0
  43. data/test/dummy/app/jobs/application_job.rb +7 -0
  44. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  45. data/test/dummy/app/models/application_record.rb +3 -0
  46. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  47. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  48. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  49. data/test/dummy/bin/rails +4 -0
  50. data/test/dummy/bin/rake +4 -0
  51. data/test/dummy/bin/setup +33 -0
  52. data/test/dummy/config.ru +5 -0
  53. data/test/dummy/config/application.rb +19 -0
  54. data/test/dummy/config/boot.rb +5 -0
  55. data/test/dummy/config/cable.yml +10 -0
  56. data/test/dummy/config/database.yml +25 -0
  57. data/test/dummy/config/environment.rb +5 -0
  58. data/test/dummy/config/environments/development.rb +62 -0
  59. data/test/dummy/config/environments/production.rb +112 -0
  60. data/test/dummy/config/environments/test.rb +49 -0
  61. data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
  62. data/test/dummy/config/initializers/assets.rb +12 -0
  63. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  64. data/test/dummy/config/initializers/content_security_policy.rb +28 -0
  65. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  66. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  67. data/test/dummy/config/initializers/inflections.rb +16 -0
  68. data/test/dummy/config/initializers/mime_types.rb +4 -0
  69. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  70. data/test/dummy/config/locales/en.yml +33 -0
  71. data/test/dummy/config/puma.rb +38 -0
  72. data/test/dummy/config/routes.rb +3 -0
  73. data/test/dummy/config/spring.rb +6 -0
  74. data/test/dummy/config/storage.yml +34 -0
  75. data/test/dummy/db/development.sqlite3 +0 -0
  76. data/test/dummy/log/development.log +8 -0
  77. data/test/dummy/public/404.html +67 -0
  78. data/test/dummy/public/422.html +67 -0
  79. data/test/dummy/public/500.html +66 -0
  80. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  81. data/test/dummy/public/apple-touch-icon.png +0 -0
  82. data/test/dummy/public/favicon.ico +0 -0
  83. data/test/dummy/tmp/development_secret.txt +1 -0
  84. data/test/integration/navigation_test.rb +7 -0
  85. data/test/jinda_test.rb +7 -0
  86. data/test/test_helper.rb +19 -0
  87. metadata +90 -156
  88. data/lib/generators/jinda/templates/app/assets/images/4dcity-old.ico +0 -0
  89. data/lib/generators/jinda/templates/app/assets/images/4dcity.ico +0 -0
  90. data/lib/generators/jinda/templates/app/assets/images/account.png +0 -0
  91. data/lib/generators/jinda/templates/app/assets/images/add.png +0 -0
  92. data/lib/generators/jinda/templates/app/assets/images/ajax-loader-circle.gif +0 -0
  93. data/lib/generators/jinda/templates/app/assets/images/ajax-loader.gif +0 -0
  94. data/lib/generators/jinda/templates/app/assets/images/anchor.png +0 -0
  95. data/lib/generators/jinda/templates/app/assets/images/application_double.png +0 -0
  96. data/lib/generators/jinda/templates/app/assets/images/application_form_edit.png +0 -0
  97. data/lib/generators/jinda/templates/app/assets/images/arrow_left.png +0 -0
  98. data/lib/generators/jinda/templates/app/assets/images/arrow_right.png +0 -0
  99. data/lib/generators/jinda/templates/app/assets/images/arrow_turn_left.png +0 -0
  100. data/lib/generators/jinda/templates/app/assets/images/arrow_turn_right.png +0 -0
  101. data/lib/generators/jinda/templates/app/assets/images/calendar.png +0 -0
  102. data/lib/generators/jinda/templates/app/assets/images/cancel.png +0 -0
  103. data/lib/generators/jinda/templates/app/assets/images/chart_bar.png +0 -0
  104. data/lib/generators/jinda/templates/app/assets/images/clock.png +0 -0
  105. data/lib/generators/jinda/templates/app/assets/images/cog.png +0 -0
  106. data/lib/generators/jinda/templates/app/assets/images/control_fastforward.png +0 -0
  107. data/lib/generators/jinda/templates/app/assets/images/control_play.png +0 -0
  108. data/lib/generators/jinda/templates/app/assets/images/cross.png +0 -0
  109. data/lib/generators/jinda/templates/app/assets/images/delete.png +0 -0
  110. data/lib/generators/jinda/templates/app/assets/images/external-link.png +0 -0
  111. data/lib/generators/jinda/templates/app/assets/images/facebook-continue-button.png +0 -0
  112. data/lib/generators/jinda/templates/app/assets/images/facebooksmall.png +0 -0
  113. data/lib/generators/jinda/templates/app/assets/images/favicon.ico +0 -0
  114. data/lib/generators/jinda/templates/app/assets/images/freemind(mm).png +0 -0
  115. data/lib/generators/jinda/templates/app/assets/images/google-continue-button.png +0 -0
  116. data/lib/generators/jinda/templates/app/assets/images/help.png +0 -0
  117. data/lib/generators/jinda/templates/app/assets/images/highway-menu.png +0 -0
  118. data/lib/generators/jinda/templates/app/assets/images/highway.png +0 -0
  119. data/lib/generators/jinda/templates/app/assets/images/house.png +0 -0
  120. data/lib/generators/jinda/templates/app/assets/images/icons-18-black.png +0 -0
  121. data/lib/generators/jinda/templates/app/assets/images/icons-18-white.png +0 -0
  122. data/lib/generators/jinda/templates/app/assets/images/icons-36-black.png +0 -0
  123. data/lib/generators/jinda/templates/app/assets/images/icons-36-white.png +0 -0
  124. data/lib/generators/jinda/templates/app/assets/images/logo.png +0 -0
  125. data/lib/generators/jinda/templates/app/assets/images/logo_jinda.png +0 -0
  126. data/lib/generators/jinda/templates/app/assets/images/logout.png +0 -0
  127. data/lib/generators/jinda/templates/app/assets/images/new.gif +0 -0
  128. data/lib/generators/jinda/templates/app/assets/images/new.png +0 -0
  129. data/lib/generators/jinda/templates/app/assets/images/page.png +0 -0
  130. data/lib/generators/jinda/templates/app/assets/images/page_attach.png +0 -0
  131. data/lib/generators/jinda/templates/app/assets/images/page_green.png +0 -0
  132. data/lib/generators/jinda/templates/app/assets/images/page_output.png +0 -0
  133. data/lib/generators/jinda/templates/app/assets/images/page_pdf.png +0 -0
  134. data/lib/generators/jinda/templates/app/assets/images/pencil.png +0 -0
  135. data/lib/generators/jinda/templates/app/assets/images/printer.png +0 -0
  136. data/lib/generators/jinda/templates/app/assets/images/refresh.png +0 -0
  137. data/lib/generators/jinda/templates/app/assets/images/report.png +0 -0
  138. data/lib/generators/jinda/templates/app/assets/images/rssmall.png +0 -0
  139. data/lib/generators/jinda/templates/app/assets/images/tick.png +0 -0
  140. data/lib/generators/jinda/templates/app/assets/images/twittersmall.png +0 -0
  141. data/lib/generators/jinda/templates/app/assets/images/user.png +0 -0
  142. data/lib/generators/jinda/templates/app/assets/images/user_admin_gear.png +0 -0
  143. data/lib/generators/jinda/templates/app/assets/images/view_code.png +0 -0
  144. data/lib/generators/jinda/templates/app/assets/javascripts/application.js-jqm +0 -27
  145. data/lib/generators/jinda/templates/app/assets/javascripts/cable.js +0 -13
  146. data/lib/generators/jinda/templates/app/assets/javascripts/disable_enter_key.js +0 -10
  147. data/lib/generators/jinda/templates/app/assets/javascripts/iscroll-wrapper.js +0 -32
  148. data/lib/generators/jinda/templates/app/assets/javascripts/iscroll.js +0 -1084
  149. data/lib/generators/jinda/templates/app/assets/javascripts/jinda.js +0 -14
  150. data/lib/generators/jinda/templates/app/assets/javascripts/jquery.mobile-1.2.1.js +0 -9272
  151. data/lib/generators/jinda/templates/app/assets/javascripts/jquery.mobile.datebox.js +0 -1778
  152. data/lib/generators/jinda/templates/app/assets/javascripts/jquery.mobile.splitview.js +0 -695
  153. data/lib/generators/jinda/templates/app/assets/stylesheets/app.scss +0 -90
  154. data/lib/generators/jinda/templates/app/assets/stylesheets/articles.scss +0 -94
  155. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/sarabun.eot +0 -0
  156. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/sarabun.ttf +0 -0
  157. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/sarabun.woff +0 -0
  158. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/sarabun_bold.ttf +0 -0
  159. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/sarabun_bolditalic.ttf +0 -0
  160. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/sarabun_italic.ttf +0 -0
  161. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/thsarabunnew-webfont.eot +0 -0
  162. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/thsarabunnew-webfont.ttf +0 -0
  163. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/thsarabunnew-webfont.woff +0 -0
  164. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/thsarabunnew.css +0 -47
  165. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/thsarabunnew_bold-webfont.eot +0 -0
  166. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/thsarabunnew_bold-webfont.ttf +0 -0
  167. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/thsarabunnew_bold-webfont.woff +0 -0
  168. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/thsarabunnew_bolditalic-webfont.eot +0 -0
  169. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/thsarabunnew_bolditalic-webfont.ttf +0 -0
  170. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/thsarabunnew_bolditalic-webfont.woff +0 -0
  171. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/thsarabunnew_italic-webfont.eot +0 -0
  172. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/thsarabunnew_italic-webfont.ttf +0 -0
  173. data/lib/generators/jinda/templates/app/assets/stylesheets/fonts/thsarabunnew_italic-webfont.woff +0 -0
  174. data/lib/generators/jinda/templates/app/assets/stylesheets/images/ajax-loader.gif +0 -0
  175. data/lib/generators/jinda/templates/app/assets/stylesheets/images/button_black.png +0 -0
  176. data/lib/generators/jinda/templates/app/assets/stylesheets/images/button_blue.png +0 -0
  177. data/lib/generators/jinda/templates/app/assets/stylesheets/images/button_red.png +0 -0
  178. data/lib/generators/jinda/templates/app/assets/stylesheets/images/icons-18-black.png +0 -0
  179. data/lib/generators/jinda/templates/app/assets/stylesheets/images/icons-18-white.png +0 -0
  180. data/lib/generators/jinda/templates/app/assets/stylesheets/images/icons-36-black.png +0 -0
  181. data/lib/generators/jinda/templates/app/assets/stylesheets/images/icons-36-white.png +0 -0
  182. data/lib/generators/jinda/templates/app/assets/stylesheets/images/indicator.gif +0 -0
  183. data/lib/generators/jinda/templates/app/assets/stylesheets/jinda.css +0 -52
  184. data/lib/generators/jinda/templates/app/assets/stylesheets/jquery.mobile-1.2.1.css +0 -2339
  185. data/lib/generators/jinda/templates/app/assets/stylesheets/jquery.mobile.datebox.css +0 -65
  186. data/lib/generators/jinda/templates/app/assets/stylesheets/jquery.mobile.grids.collapsible.css +0 -122
  187. data/lib/generators/jinda/templates/app/assets/stylesheets/jquery.mobile.splitview.css +0 -128
  188. data/lib/generators/jinda/templates/app/assets/stylesheets/kul-4.2.css +0 -1516
  189. data/lib/generators/jinda/templates/app/assets/stylesheets/kul-4.2.min.css +0 -11
  190. data/lib/generators/jinda/templates/app/assets/stylesheets/modules.scss +0 -84
  191. data/lib/generators/jinda/templates/app/assets/stylesheets/sarabun.css +0 -37
  192. data/lib/generators/jinda/templates/app/assets/stylesheets/social.scss +0 -133
  193. data/lib/generators/jinda/templates/app/controllers/concerns/jinda_general_concern.rb +0 -179
  194. data/lib/generators/jinda/templates/app/controllers/concerns/jinda_run_concern.rb +0 -365
  195. data/lib/generators/jinda/templates/app/controllers/jinda_org/devs_controller.rb +0 -2
  196. data/lib/generators/jinda/templates/app/controllers/jinda_org/jinda_controller.rb +0 -66
  197. data/lib/generators/jinda/templates/app/views/jinda/_activity.md +0 -10
  198. data/lib/generators/jinda/templates/app/views/jinda/_menu.haml +0 -27
  199. data/lib/generators/jinda/templates/app/views/jinda/_menu_mm.haml +0 -44
  200. data/lib/generators/jinda/templates/app/views/jinda/_model.md +0 -5
  201. data/lib/generators/jinda/templates/app/views/jinda/_modul.md +0 -9
  202. data/lib/generators/jinda/templates/app/views/jinda/_pending_home.haml +0 -5
  203. data/lib/generators/jinda/templates/app/views/jinda/_pending_page.haml +0 -24
  204. data/lib/generators/jinda/templates/app/views/jinda/_service.md +0 -24
  205. data/lib/generators/jinda/templates/app/views/jinda/_static.haml +0 -13
  206. data/lib/generators/jinda/templates/app/views/jinda/doc-thai.md +0 -37
  207. data/lib/generators/jinda/templates/app/views/jinda/doc.md +0 -36
  208. data/lib/generators/jinda/templates/app/views/jinda/error_logs.haml +0 -22
  209. data/lib/generators/jinda/templates/app/views/jinda/feed.rss.builder +0 -27
  210. data/lib/generators/jinda/templates/app/views/jinda/help.haml +0 -20
  211. data/lib/generators/jinda/templates/app/views/jinda/index.html.haml +0 -53
  212. data/lib/generators/jinda/templates/app/views/jinda/logs.haml +0 -22
  213. data/lib/generators/jinda/templates/app/views/jinda/notice_logs.haml +0 -18
  214. data/lib/generators/jinda/templates/app/views/jinda/pending.haml +0 -1
  215. data/lib/generators/jinda/templates/app/views/jinda/run_form.haml +0 -42
  216. data/lib/generators/jinda/templates/app/views/jinda/run_output.haml +0 -38
  217. data/lib/generators/jinda/templates/app/views/jinda/search.haml +0 -20
  218. data/lib/generators/jinda/templates/app/views/jinda/status.haml +0 -61
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 270299e97f9a8656002d344e027b0dae973ffa4de5aea1a09c17b057ac1ff013
4
- data.tar.gz: c56bd2a9f51bd551bae663b87004dd94a89103c4ebdc02abd54fea862a90ab8f
3
+ metadata.gz: a1d3b5d1b0bb5e86730495489becf0992dea17013d78b342c60b99a2b529c42e
4
+ data.tar.gz: a75414817131984c8c5cf440169ec3a25fed3e364036cb919e26c0d474d221db
5
5
  SHA512:
6
- metadata.gz: c81b86cb7774c918d0483f0c883c408cf286741f0c3395af64bb760adc916aa85c93e8648319ea5a75982b34ed6d5eb0e4d079890a2602cc8965ba13eb1abf65
7
- data.tar.gz: c588613108ec0a86eb83590198889f74d7e0a00b49b7ab3daca6129342e5060b75b004cc58724d967c07a90f1e7dd2536914e0ee02f5448f943055355a807c26
6
+ metadata.gz: f49309793d39cb287ebfb218d9ef03bd68db3af2ed7731aa7915cf522e66ac9a55e04c9483d9f9ec354339f16bfad9b81a711dd84301b2f645b2e29208da0d76
7
+ data.tar.gz: 61a3db47b440f9a9d58bdb9ae47c927b1fa48951043555c32c7a2d9601a6a536f91a306a1c983d06b216fb4da18d5a678a6d7a491cb5d90da9b7f8488b7caf4d
data/README.md CHANGED
@@ -40,7 +40,7 @@ app without ActiveRecord
40
40
 
41
41
  ## Add jinda to your Gemfile:
42
42
 
43
- gem 'jinda', '~> 0.6.1'
43
+ gem 'jinda', '~> 0.6.7'
44
44
 
45
45
  For Development (most updated)
46
46
 
@@ -65,6 +65,13 @@ module Jinda
65
65
  end
66
66
  end
67
67
 
68
+ # desc "Setup Dockerfile"
69
+ # def setup_docker
70
+ # FileUtils.mv "Dockerfile", "Dockerfile"
71
+ # FileUtils.mv "docker-compose.yml", "docker-compose.yml"
72
+ # FileUtils.mv "entrypoint.sh", "entrypoint.sh"
73
+ # end
74
+
68
75
  def finish
69
76
  puts " configured omniauth.\n"
70
77
  puts " configured Mongoid.\n"
@@ -79,13 +79,14 @@ module Jinda
79
79
  # inside("app/assets/javascripts") {(File.file? "application.js") ? ( say "Please include application-org.js in application.js", :red) : (FileUtils.mv 'application-org.js', 'application.js')}
80
80
  # inside("app/assets/stylesheets") {(File.file? "application.css") ? ( say "Please include application-org.css in application.css", :red) : (FileUtils.mv 'application-org.css', 'application.css')}
81
81
  # inside("app/assets/stylesheets") {(File.file? "application.css.scss") ? ( say "Please include application-org.css.scss in application.css.scss", :red) : (FileUtils.mv 'application-org.css.scss', 'application.css.scss')}
82
- inside("app/controllers") {(File.file? "application_controller.rb") ? ( say "Pleas merge existing jinda_org/application_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/application_controller.rb', 'application_controller.rb')}
83
82
  inside("app/controllers") {(File.file? "admins_controller.rb") ? ( say "Please merge existing jinda_org/admins_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/admins_controller.rb', 'admins_controller.rb')}
84
83
  inside("app/controllers") {(File.file? "articles_controller.rb") ? ( say "Please merge existing jinda_org/articles_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/articles_controller.rb', 'articles_controller.rb')}
85
84
  inside("app/controllers") {(File.file? "comments_controller.rb") ? ( say "Please merge existing jinda_org/comments_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/comments_controller.rb', 'comments_controller.rb')}
86
85
  inside("app/controllers") {(File.file? "docs_controller.rb") ? ( say "Please merge existing jinda_org/docs_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/docs_controller.rb', 'docs_controller.rb')}
87
86
  inside("app/controllers") {(File.file? "identities_controller.rb") ? ( say "Please merge existing jinda_org/identities_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/identities_controller.rb', 'identities_controller.rb')}
88
- inside("app/controllers") {(File.file? "jinda_controller.rb") ? ( say "Please merge existing jinda_org/jinda_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/jinda_controller.rb', 'jinda_controller.rb')}
87
+ inside("app/controllers") {(File.file? "application_controller.rb") ? ( say "Pleas merge existing jinda_org/application_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/application_controller.rb', 'application_controller.rb')}
88
+ ## Moved to Engine
89
+ # inside("app/controllers") {(File.file? "jinda_controller.rb") ? ( say "Please merge existing jinda_org/jinda_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/jinda_controller.rb', 'jinda_controller.rb')}
89
90
  inside("app/controllers") {(File.file? "password_resets_controller.rb") ? ( say "Please merge existing jinda_org/password_resets_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/password_resets_controller.rb', 'password_resets_controller.rb')}
90
91
  inside("app/controllers") {(File.file? "password_resets.rb") ? ( say "Please merge existing jinda_org/password_resets.rb after this installation", :red) : (FileUtils.mv 'jinda_org/password_resets.rb', 'password_resets.rb')}
91
92
  inside("app/controllers") {(File.file? "sessions_controller.rb") ? ( say "Please merge existing jinda_org/sessions_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/sessions_controller.rb', 'sessions_controller.rb')}
@@ -94,49 +95,50 @@ module Jinda
94
95
  inside("app/controllers") {(File.file? "notes_controller.rb") ? ( say "Please merge existing jinda_org/notes_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/notes_controller.rb', 'notes_controller.rb')}
95
96
  end
96
97
  # routes created each line as reversed order in routes
98
+ # Moved routes to Engine
97
99
  def setup_routes
98
100
  # route "end"
99
- route " end"
100
- route " namespace :v1 do resources :notes, :only => [:index] end"
101
- route " namespace :api do"
102
- route "post '/api/v1/notes' => 'api/v1/notes#create', as: 'api_v1_notes'"
103
- route "get '/api/v1/notes/my' => 'api/v1/notes#my'"
104
- route "\# api"
101
+ # route " end"
102
+ # route " namespace :v1 do resources :notes, :only => [:index] end"
103
+ # route " namespace :api do"
104
+ # route "post '/api/v1/notes' => 'api/v1/notes#create', as: 'api_v1_notes'"
105
+ # route "get '/api/v1/notes/my' => 'api/v1/notes#my'"
106
+ # route "\# api"
105
107
  route "root :to => 'jinda#index'"
106
- route "resources :jinda, :only => [:index, :new]"
107
- route "resources :password_resets"
108
- route "resources :sessions"
109
- route "resources :identities"
110
- route "resources :users"
111
- route "resources :docs"
112
- route "resources :notes"
113
- route "resources :comments"
114
- route "resources :articles do resources :comments end"
115
- route "get '/jinda/document/:id' => 'jinda#document'"
116
- route "get '/notes/destroy/:id' => 'notes#destroy'"
117
- route "get '/notes/my/destroy/:id' => 'notes#destroy'"
118
- route "get '/docs/my/destroy' => 'docs#destroy'"
119
- route "get '/notes/my' => 'notes/my'"
120
- route "get '/docs/my' => 'docs/my'"
121
- route "get '/articles/edit' => 'articles/edit'"
122
- route "get '/articles/show' => 'articles/show'"
123
- route "get '/articles/my/destroy' => 'articles#destroy'"
124
- route "get '/articles/my' => 'articles#my'"
125
- route "get '/logout' => 'sessions#destroy', :as => 'logout'"
126
- route "get '/auth/failure' => 'sessions#destroy'"
127
- route "get '/auth/:provider/callback' => 'sessions#create'"
128
- route "post '/auth/:provider/callback' => 'sessions#create'"
129
- route "\# end jinda method routes"
130
- route "post '/jinda/end_output' => 'jinda#end_output'"
131
- route "post '/jinda/end_form' => 'jinda#end_form'"
132
- route "post '/jinda/pending' => 'jinda#index'"
133
- route "post '/jinda/init' => 'jinda#init'"
134
- route "jinda_methods.each do \|aktion\| get \"/jinda/\#\{aktion\}\" => \"jinda#\#\{aktion\}\" end"
135
- route "jinda_methods += ['error_logs', 'notice_logs', 'cancel', 'run_output', 'end_output']"
136
- route "jinda_methods += ['run_redirect', 'run_direct_to','run_if']"
137
- route "jinda_methods += ['init', 'run', 'run_mail', 'document', 'run_do', 'run_form', 'end_form']"
138
- route "jinda_methods = ['pending', 'status', 'search', 'doc', 'doc_print', 'logs', 'ajax_notice']"
139
- route "\# start jiinda method routes"
108
+ # route "resources :jinda, :only => [:index, :new]"
109
+ # route "resources :password_resets"
110
+ # route "resources :sessions"
111
+ # route "resources :identities"
112
+ # route "resources :users"
113
+ # route "resources :docs"
114
+ # route "resources :notes"
115
+ # route "resources :comments"
116
+ # route "resources :articles do resources :comments end"
117
+ # route "get '/jinda/document/:id' => 'jinda#document'"
118
+ # route "get '/notes/destroy/:id' => 'notes#destroy'"
119
+ # route "get '/notes/my/destroy/:id' => 'notes#destroy'"
120
+ # route "get '/docs/my/destroy' => 'docs#destroy'"
121
+ # route "get '/notes/my' => 'notes/my'"
122
+ # route "get '/docs/my' => 'docs/my'"
123
+ # route "get '/articles/edit' => 'articles/edit'"
124
+ # route "get '/articles/show' => 'articles/show'"
125
+ # route "get '/articles/my/destroy' => 'articles#destroy'"
126
+ # route "get '/articles/my' => 'articles#my'"
127
+ # route "get '/logout' => 'sessions#destroy', :as => 'logout'"
128
+ # route "get '/auth/failure' => 'sessions#destroy'"
129
+ # route "get '/auth/:provider/callback' => 'sessions#create'"
130
+ # route "post '/auth/:provider/callback' => 'sessions#create'"
131
+ # route "\# end jinda method routes"
132
+ # route "post '/jinda/end_output' => 'jinda#end_output'"
133
+ # route "post '/jinda/end_form' => 'jinda#end_form'"
134
+ # route "post '/jinda/pending' => 'jinda#index'"
135
+ # route "post '/jinda/init' => 'jinda#init'"
136
+ # route "jinda_methods.each do \|aktion\| get \"/jinda/\#\{aktion\}\" => \"jinda#\#\{aktion\}\" end"
137
+ # route "jinda_methods += ['error_logs', 'notice_logs', 'cancel', 'run_output', 'end_output']"
138
+ # route "jinda_methods += ['run_redirect', 'run_direct_to','run_if']"
139
+ # route "jinda_methods += ['init', 'run', 'run_mail', 'document', 'run_do', 'run_form', 'end_form']"
140
+ # route "jinda_methods = ['pending', 'status', 'search', 'doc', 'doc_print', 'logs', 'ajax_notice']"
141
+ # route "\# start jiinda method routes"
140
142
  end
141
143
 
142
144
  def setup_env
@@ -210,6 +212,7 @@ Mongoid::Config.belongs_to_required_by_default = false
210
212
  end
211
213
  inject_into_file 'config/environments/development.rb', :after => 'config.action_mailer.raise_delivery_errors = false' do
212
214
  "\n config.action_mailer.default_url_options = { :host => 'localhost:3000' }"
215
+ "\n config.assets.check_precompiled_asset = false"
213
216
  end
214
217
  inject_into_file 'config/environments/production.rb', :after => 'config.assets.compile = false' do
215
218
  "\n config.assets.compile = true"
@@ -0,0 +1,24 @@
1
+ # https://docs.docker.com/compose/rails/
2
+ FROM ruby:2.6.3
3
+ RUN apt-get update -qq
4
+ RUN mkdir /myapp
5
+ WORKDIR /myapp
6
+ COPY Gemfile /myapp/Gemfile
7
+ # COPY Gemfile.lock /myapp/Gemfile.lock
8
+
9
+ RUN bundle install
10
+ COPY . /myapp
11
+
12
+ # Set Rails environment to production
13
+ # ENV RAILS_ENV production
14
+ # RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
15
+ # && apt install -y nodejs
16
+
17
+ # Add a script to be executed every time the container starts.
18
+ COPY entrypoint.sh /usr/bin/
19
+ RUN chmod +x /usr/bin/entrypoint.sh
20
+ ENTRYPOINT ["entrypoint.sh"]
21
+ EXPOSE 3000
22
+
23
+ # Start the main process.
24
+ CMD ["rails", "server", "-b", "0.0.0.0"]
@@ -10,15 +10,6 @@
10
10
  // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
11
  // GO AFTER THE REQUIRES BELOW.
12
12
  //
13
- //= require jquery
14
- //= require jquery_ujs
15
- //= require jquery.mobile.splitview
16
- //= require jquery.mobile-1.2.1
17
- //= require jquery.mobile.datebox
18
- //= require iscroll-wrapper
19
- //= require iscroll
20
- //= require jinda
21
- // require turbolinks
22
- // require disable_enter_key.js
13
+ //= require jinda_jqm
23
14
 
24
15
 
@@ -12,23 +12,4 @@
12
12
  *= require_self
13
13
  *= require normalize-rails
14
14
  */
15
-
16
- @import "jquery.mobile-1.2.1";
17
- @import "jquery.mobile.splitview";
18
- @import "jquery.mobile.grids.collapsible";
19
- @import "jquery.mobile.datebox.css";
20
- @import "sarabun";
21
- @import "jinda";
22
- @import "kul-4.2";
23
- @import "articles";
24
- @import "app.scss";
25
- @import "font-awesome-sprockets";
26
- @import "font-awesome";
27
- @import "social";
28
-
29
-
30
-
31
-
32
-
33
-
34
-
15
+ @import "jinda_jqm"
@@ -12,8 +12,10 @@ class ArticlesController < ApplicationController
12
12
  end
13
13
 
14
14
  def show
15
- @article = Article.find(params[:article_id])
16
- @comments = @article.comments.desc(:created_at).page(params[:page]).per(10)
15
+ @article = Article.find(article_params)
16
+ @commentable = @article
17
+ @comments = @commentable.comments.desc(:created_at).page(params[:page]).per(10)
18
+
17
19
  prepare_meta_tags(title: @article.title,
18
20
  description: @article.text,
19
21
  keywords: @article.keywords)
@@ -92,7 +94,7 @@ class ArticlesController < ApplicationController
92
94
  end
93
95
 
94
96
  def article_params
95
- params[:article_id]
97
+ [params[:article_id], params[:id]].detect { |p| !p.nil? }
96
98
  end
97
99
 
98
100
  def load_edit_article
@@ -1,19 +1,31 @@
1
1
  class CommentsController < ApplicationController
2
+ before_action :comment_params, only: [:create]
3
+ before_action :load_commmentable
4
+
5
+ def index
6
+ @comments = @commentable.comments
7
+ end
2
8
 
3
9
  def create
4
- @article = Article.find(article_params["article_id"])
5
- @comment = @article.comments.new(comment_params)
10
+ @comment = @commentable.comments.new comment_params
6
11
  @comment.save!
7
- redirect_to controller: 'articles', action: 'show', article_id: @article
12
+ redirect_to [@commentable], notice: "Comment created"
8
13
  end
9
14
 
10
15
  private
11
16
 
12
- def article_params
13
- params.require(:comment).permit(:article_id)
14
- end
17
+ # def article_params
18
+ # params.require(:comment).permit(:article_id)
19
+ # end
15
20
 
16
21
  def comment_params
17
- params.require(:comment).permit(:body, :article_id, :user_id)
22
+ resource = request.path.split('/')[1]
23
+ commentable_id = "#{resource.singularize.to_sym}_id" #:article_id
24
+ params.require(:comment).permit(:body, :user_id, commentable_id.to_sym)
18
25
  end
26
+
27
+ def load_commmentable
28
+ resource, id = request.path.split('/')[1,2]
29
+ @commentable = resource.singularize.classify.constantize.find(id)
30
+ end
19
31
  end
@@ -25,7 +25,7 @@
25
25
  </node>
26
26
  </node>
27
27
  </node>
28
- <node CREATED="1275752678377" ID="ID_1348489452" MODIFIED="1588883079396" TEXT="admins:Admin">
28
+ <node CREATED="1275752678377" FOLDED="true" ID="ID_1348489452" MODIFIED="1602251558474" TEXT="admins:Admin">
29
29
  <node CREATED="1275752688167" ID="ID_229996461" MODIFIED="1275752690948" TEXT="role:a"/>
30
30
  <node CREATED="1282722836614" ID="ID_1213363124" MODIFIED="1330477902602" TEXT="edit_role:edit user role">
31
31
  <node CREATED="1282722862918" ID="ID_1190117882" MODIFIED="1330477922159" TEXT="select_user:select user">
@@ -44,7 +44,7 @@
44
44
  <node CREATED="1275790679363" ID="ID_829325467" MODIFIED="1511159696044" TEXT="link: logs: /jinda/logs"/>
45
45
  <node CREATED="1507573166973" ID="ID_351025910" MODIFIED="1511159700908" TEXT="link: docs: /jinda/doc"/>
46
46
  </node>
47
- <node CREATED="1273706796854" ID="ID_1003882979" MODIFIED="1588964401951" TEXT="devs: Developer">
47
+ <node CREATED="1273706796854" FOLDED="true" ID="ID_1003882979" MODIFIED="1602251560242" TEXT="devs: Developer">
48
48
  <node CREATED="1275373154914" ID="ID_340725299" MODIFIED="1275373158632" TEXT="role:d"/>
49
49
  <node CREATED="1275788317299" ID="ID_716276608" MODIFIED="1511159716471" TEXT="link: error_logs: /jinda/error_logs"/>
50
50
  <node CREATED="1275788317299" ID="ID_1570419198" MODIFIED="1587858894833" TEXT="link: notice_logs: /jinda/notice_logs"/>
@@ -87,7 +87,7 @@
87
87
  </node>
88
88
  </node>
89
89
  </node>
90
- <node CREATED="1493393619430" ID="ID_554831343" MODIFIED="1592926786394" TEXT="notes: Notes">
90
+ <node CREATED="1493393619430" FOLDED="true" ID="ID_554831343" MODIFIED="1602251562724" TEXT="notes: Notes">
91
91
  <node CREATED="1493489768542" ID="ID_737469676" MODIFIED="1589772615102" TEXT="link:My Notes: /notes/my">
92
92
  <node CREATED="1493490295677" ID="ID_514416082" MODIFIED="1493490302239" TEXT="role:m"/>
93
93
  </node>
@@ -151,7 +151,7 @@
151
151
  </node>
152
152
  </node>
153
153
  </node>
154
- <node CREATED="1493393619430" ID="ID_328863650" MODIFIED="1592785024002" TEXT="articles: Article">
154
+ <node CREATED="1493393619430" FOLDED="true" ID="ID_328863650" MODIFIED="1602251538059" TEXT="articles: Article">
155
155
  <node CREATED="1493419096527" ID="ID_1521905276" MODIFIED="1493478060121" TEXT="link: All Articles: /articles"/>
156
156
  <node CREATED="1493489768542" FOLDED="true" ID="ID_1376361427" MODIFIED="1589757167952" TEXT="link: My article: /articles/my">
157
157
  <node CREATED="1493490295677" ID="ID_628476988" MODIFIED="1493490302239" TEXT="role:m"/>
@@ -199,7 +199,7 @@
199
199
  </node>
200
200
  </node>
201
201
  </node>
202
- <node CREATED="1493664700564" ID="ID_704959130" MODIFIED="1592950100226" TEXT="comments: Comment">
202
+ <node CREATED="1493664700564" FOLDED="true" ID="ID_704959130" MODIFIED="1602251564023" TEXT="comments: Comment">
203
203
  <icon BUILTIN="button_cancel"/>
204
204
  <node CREATED="1493665155709" ID="ID_1973520751" MODIFIED="1591392666652" TEXT="new_comment: New Comment">
205
205
  <icon BUILTIN="button_cancel"/>
@@ -281,7 +281,7 @@
281
281
  <node CREATED="1273819855875" ID="ID_1429503284" MODIFIED="1330477311102" TEXT="a: admin"/>
282
282
  <node CREATED="1273819859775" ID="ID_568365839" MODIFIED="1330477315009" TEXT="d: developer"/>
283
283
  </node>
284
- <node CREATED="1273819456867" FOLDED="true" ID="ID_1677010054" MODIFIED="1591392810437" POSITION="left" TEXT="models">
284
+ <node CREATED="1273819456867" ID="ID_1677010054" MODIFIED="1602123498759" POSITION="left" TEXT="models">
285
285
  <node CREATED="1292122118499" FOLDED="true" ID="ID_1957754752" MODIFIED="1493705885123" TEXT="person">
286
286
  <node CREATED="1292122135809" ID="ID_1617970069" MODIFIED="1332878659106" TEXT="fname"/>
287
287
  <node CREATED="1292122150362" ID="ID_1200135538" MODIFIED="1332878662388" TEXT="lname"/>
@@ -305,7 +305,7 @@
305
305
  <node CREATED="1292243471343" ID="ID_1859608350" MODIFIED="1310195256623" TEXT="lat: float"/>
306
306
  <node CREATED="1292243477436" ID="ID_48497260" MODIFIED="1310195262534" TEXT="lng: float"/>
307
307
  </node>
308
- <node CREATED="1493418879485" FOLDED="true" ID="ID_1995497233" MODIFIED="1583097163789" TEXT="article">
308
+ <node CREATED="1493418879485" ID="ID_1995497233" MODIFIED="1602529325998" TEXT="article">
309
309
  <node CREATED="1493418891110" ID="ID_364756011" MODIFIED="1493418905253" TEXT="title"/>
310
310
  <node CREATED="1493418906868" ID="ID_1676483995" MODIFIED="1493418911919" TEXT="text"/>
311
311
  <node CREATED="1493487131376" ID="ID_1334057464" MODIFIED="1538328284823" TEXT="belongs_to :user, :class_name =&gt; &quot;User&quot;">
@@ -320,18 +320,6 @@
320
320
  <node CREATED="1494181636998" ID="ID_229502630" MODIFIED="1494181660419" TEXT="body"/>
321
321
  <node CREATED="1497913676275" ID="ID_404103076" MODIFIED="1497913685065" TEXT="keywords"/>
322
322
  </node>
323
- <node CREATED="1493418915637" FOLDED="true" ID="ID_429078131" MODIFIED="1583097162517" TEXT="comment">
324
- <node CREATED="1493418939760" ID="ID_1251093062" MODIFIED="1493418943423" TEXT="body"/>
325
- <node CREATED="1493418945686" ID="ID_911071644" MODIFIED="1493418986711" TEXT="belongs_to :article">
326
- <icon BUILTIN="edit"/>
327
- </node>
328
- <node CREATED="1493643129947" ID="ID_588013696" MODIFIED="1493643146424" TEXT="belongs_to :user">
329
- <icon BUILTIN="edit"/>
330
- </node>
331
- <node CREATED="1493718512191" ID="ID_173203253" MODIFIED="1493718583874" TEXT="validates :body, :user_id, :article_id, presence: true">
332
- <icon BUILTIN="edit"/>
333
- </node>
334
- </node>
335
323
  <node CREATED="1494040082403" FOLDED="true" ID="ID_864577403" MODIFIED="1583097161145" TEXT="picture">
336
324
  <node CREATED="1494040091583" ID="ID_679208099" MODIFIED="1494040119098" TEXT="picture"/>
337
325
  <node CREATED="1494040120208" ID="ID_1266154874" MODIFIED="1494040125130" TEXT="description"/>
@@ -361,6 +349,21 @@
361
349
  <icon BUILTIN="edit"/>
362
350
  </node>
363
351
  </node>
352
+ <node CREATED="1493418915637" ID="ID_429078131" MODIFIED="1602591443455" TEXT="comment">
353
+ <node CREATED="1493418939760" ID="ID_1251093062" MODIFIED="1493418943423" TEXT="body"/>
354
+ <node CREATED="1493418945686" ID="ID_911071644" MODIFIED="1602529513657" TEXT="belongs_to :article, :class_name =&gt; &quot;Article&quot; ">
355
+ <icon BUILTIN="edit"/>
356
+ </node>
357
+ <node CREATED="1493643129947" ID="ID_588013696" MODIFIED="1602110865206" TEXT="belongs_to :user, :class_name =&gt; &quot;User&quot; ">
358
+ <icon BUILTIN="edit"/>
359
+ </node>
360
+ <node CREATED="1601847760278" ID="ID_1288333428" MODIFIED="1602591549062" TEXT="belongs_to :commentable, polymorphic: true ">
361
+ <icon BUILTIN="edit"/>
362
+ </node>
363
+ <node CREATED="1602591560333" ID="ID_598892151" MODIFIED="1602592677709" TEXT="index({ commentable_id: 1, commentable_type: 1}) ">
364
+ <icon BUILTIN="edit"/>
365
+ </node>
366
+ </node>
364
367
  </node>
365
368
  </node>
366
369
  </map>
@@ -4,8 +4,10 @@ class Comment
4
4
  # jinda begin
5
5
  include Mongoid::Timestamps
6
6
  field :body, :type => String
7
- belongs_to :article
8
- belongs_to :user, :class_name => "User"
9
- validates :body, :user_id, :article_id, presence: true
7
+ belongs_to :article, :class_name => "Article"
8
+ belongs_to :user, :class_name => "User"
9
+ belongs_to :job, :class_name => "Job"
10
+ belongs_to :commentable, polymorphic: true
11
+ index({ commentable_id: 1, commentable_type: 1})
10
12
  # jinda end
11
13
  end
@@ -17,7 +17,8 @@
17
17
  -#
18
18
  - if login?
19
19
  %h3 Add a comment:
20
- = form_for([@comment, @article.comments.build]) do |f|
20
+ =# form_for([@comment, @article.comments.build]) do |f|
21
+ = form_with(model: [@article, Comment.new], local: true) do |f|
21
22
  = f.hidden_field :article_id, :value => @article.id
22
23
  = f.label :body, "Comment"
23
24
  = f.text_area :body
@@ -0,0 +1,182 @@
1
+ development:
2
+ # Configure available database clients. (required)
3
+ clients:
4
+ # Defines the default client. (required)
5
+ default:
6
+ # Mongoid can connect to a URI accepted by the driver:
7
+ # uri: mongodb://user:password@mongodb.domain.com:27017/shop263603_development
8
+
9
+ # Otherwise define the parameters separately.
10
+ # This defines the name of the default database that Mongoid can connect to.
11
+ # (required).
12
+ database: shop263603_development
13
+ # Provides the hosts the default client can connect to. Must be an array
14
+ # of host:port pairs. (required)
15
+ hosts:
16
+ # - localhost:27017
17
+ - mongodb
18
+ options:
19
+ # Note that all options listed below are Ruby driver client options (the mongo gem).
20
+ # Please refer to the driver documentation of the version of the mongo gem you are using
21
+ # for the most up-to-date list of options.
22
+ #
23
+ # Change the default write concern. (default = { w: 1 })
24
+ # write:
25
+ # w: 1
26
+
27
+ # Change the default read preference. Valid options for mode are: :secondary,
28
+ # :secondary_preferred, :primary, :primary_preferred, :nearest
29
+ # (default: primary)
30
+ # read:
31
+ # mode: :secondary_preferred
32
+ # tag_sets:
33
+ # - use: web
34
+
35
+ # The name of the user for authentication.
36
+ # user: 'user'
37
+
38
+ # The password of the user for authentication.
39
+ # password: 'password'
40
+
41
+ # The user's database roles.
42
+ # roles:
43
+ # - 'dbOwner'
44
+
45
+ # Change the default authentication mechanism. Valid options are: :scram,
46
+ # :mongodb_cr, :mongodb_x509, and :plain. Note that all authentication
47
+ # mechanisms require username and password, with the exception of :mongodb_x509.
48
+ # Default on mongoDB 3.0 is :scram, default on 2.4 and 2.6 is :plain.
49
+ # auth_mech: :scram
50
+
51
+ # The database or source to authenticate the user against.
52
+ # (default: the database specified above or admin)
53
+ # auth_source: admin
54
+
55
+ # Force a the driver cluster to behave in a certain manner instead of auto-
56
+ # discovering. Can be one of: :direct, :replica_set, :sharded. Set to :direct
57
+ # when connecting to hidden members of a replica set.
58
+ # connect: :direct
59
+
60
+ # Changes the default time in seconds the server monitors refresh their status
61
+ # via ismaster commands. (default: 10)
62
+ # heartbeat_frequency: 10
63
+
64
+ # The time in seconds for selecting servers for a near read preference. (default: 0.015)
65
+ # local_threshold: 0.015
66
+
67
+ # The timeout in seconds for selecting a server for an operation. (default: 30)
68
+ # server_selection_timeout: 30
69
+
70
+ # The maximum number of connections in the connection pool. (default: 5)
71
+ # max_pool_size: 5
72
+
73
+ # The minimum number of connections in the connection pool. (default: 1)
74
+ # min_pool_size: 1
75
+
76
+ # The time to wait, in seconds, in the connection pool for a connection
77
+ # to be checked in before timing out. (default: 5)
78
+ # wait_queue_timeout: 5
79
+
80
+ # The time to wait to establish a connection before timing out, in seconds.
81
+ # (default: 10)
82
+ # connect_timeout: 10
83
+
84
+ # The timeout to wait to execute operations on a socket before raising an error.
85
+ # (default: 5)
86
+ # socket_timeout: 5
87
+
88
+ # The name of the replica set to connect to. Servers provided as seeds that do
89
+ # not belong to this replica set will be ignored.
90
+ # replica_set: name
91
+
92
+ # Whether to connect to the servers via ssl. (default: false)
93
+ # ssl: true
94
+
95
+ # The certificate file used to identify the connection against MongoDB.
96
+ # ssl_cert: /path/to/my.cert
97
+
98
+ # The private keyfile used to identify the connection against MongoDB.
99
+ # Note that even if the key is stored in the same file as the certificate,
100
+ # both need to be explicitly specified.
101
+ # ssl_key: /path/to/my.key
102
+
103
+ # A passphrase for the private key.
104
+ # ssl_key_pass_phrase: password
105
+
106
+ # Whether to do peer certification validation. (default: true)
107
+ # ssl_verify: true
108
+
109
+ # The file containing concatenated certificate authority certificates
110
+ # used to validate certs passed from the other end of the connection.
111
+ # ssl_ca_cert: /path/to/ca.cert
112
+
113
+ # Whether to truncate long log lines. (default: true)
114
+ # truncate_logs: true
115
+
116
+ # Configure Mongoid specific options. (optional)
117
+ options:
118
+ # Includes the root model name in json serialization. (default: false)
119
+ # include_root_in_json: false
120
+
121
+ # Include the _type field in serialization. (default: false)
122
+ # include_type_for_serialization: false
123
+
124
+ # Preload all models in development, needed when models use
125
+ # inheritance. (default: false)
126
+ # preload_models: false
127
+
128
+ # Raise an error when performing a #find and the document is not found.
129
+ # (default: true)
130
+ # raise_not_found_error: true
131
+ raise_not_found_error: false
132
+
133
+ # Raise an error when defining a scope with the same name as an
134
+ # existing method. (default: false)
135
+ # scope_overwrite_exception: false
136
+
137
+ # Raise an error when defining a field with the same name as an
138
+ # existing method. (default: false)
139
+ # duplicate_fields_exception: false
140
+
141
+ # Use Active Support's time zone in conversions. (default: true)
142
+ # use_activesupport_time_zone: true
143
+
144
+ # Ensure all times are UTC in the app side. (default: false)
145
+ # use_utc: false
146
+
147
+ # Set the Mongoid and Ruby driver log levels when not in a Rails
148
+ # environment. The Mongoid logger will be set to the Rails logger
149
+ # otherwise.(default: :info)
150
+ # log_level: :info
151
+
152
+ # Control whether `belongs_to` association is required. By default
153
+ # `belongs_to` will trigger a validation error if the association
154
+ # is not present. (default: true)
155
+ # belongs_to_required_by_default: true
156
+ belongs_to_required_by_default: false
157
+
158
+ # Application name that is printed to the mongodb logs upon establishing a
159
+ # connection in server versions >= 3.4. Note that the name cannot exceed 128 bytes.
160
+ # app_name: MyApplicationName
161
+
162
+ production:
163
+ clients:
164
+ default:
165
+ uri: <%= ENV['MONGODB_URI'] %>
166
+ options:
167
+ raise_not_found_error: false
168
+ belongs_to_required_by_default: false
169
+
170
+
171
+ # Use background indexes by default if `background` option not specified. (default: false)
172
+ # background_indexing: false
173
+ test:
174
+ clients:
175
+ default:
176
+ database: shop263603_test
177
+ hosts:
178
+ - localhost:27017
179
+ options:
180
+ read:
181
+ mode: :primary
182
+ max_pool_size: 1