templus_models 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (295) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +34 -0
  5. data/app/assets/javascripts/raro_crud.js +95 -0
  6. data/app/controllers/crud_controller.rb +148 -0
  7. data/app/helpers/crud_helper.rb +169 -0
  8. data/app/helpers/search_helper.rb +241 -0
  9. data/app/raro_crud/raro_crud.rb +274 -0
  10. data/app/views/crud/_crud_template.html.erb +35 -0
  11. data/app/views/crud/_edit.html.erb +1 -0
  12. data/app/views/crud/_form.html.erb +68 -0
  13. data/app/views/crud/_links.html.erb +0 -0
  14. data/app/views/crud/_new.html.erb +1 -0
  15. data/app/views/crud/_record.html.erb +51 -0
  16. data/app/views/crud/_records.html.erb +24 -0
  17. data/app/views/crud/_scopes.html.erb +18 -0
  18. data/app/views/crud/_search.html.erb +20 -0
  19. data/app/views/crud/_show.html.erb +60 -0
  20. data/app/views/crud/create.js.erb +13 -0
  21. data/app/views/crud/edit.html.erb +8 -0
  22. data/app/views/crud/index.html.erb +7 -0
  23. data/app/views/crud/new.html.erb +10 -0
  24. data/app/views/crud/show.html.erb +8 -0
  25. data/app/views/layouts/_menu_crud.html.erb +8 -0
  26. data/app/views/layouts/_template_raro_crud.html.erb +73 -0
  27. data/app/views/tabelas/_precos.html.erb +0 -0
  28. data/config/initializers/raro_search.rb +17 -0
  29. data/config/initializers/simple_form.rb +173 -0
  30. data/config/routes.rb +13 -0
  31. data/lib/generators/crud/USAGE +8 -0
  32. data/lib/generators/crud/crud_generator.rb +10 -0
  33. data/lib/generators/crud/templates/crud.rb +52 -0
  34. data/lib/generators/crud/templates/crud2.rb +58 -0
  35. data/lib/tasks/templus_models_tasks.rake +4 -0
  36. data/lib/templus_models.rb +9 -0
  37. data/lib/templus_models/engine.rb +4 -0
  38. data/lib/templus_models/version.rb +3 -0
  39. data/test/dummy/README.rdoc +28 -0
  40. data/test/dummy/Rakefile +6 -0
  41. data/test/dummy/app/assets/javascripts/application.js +14 -0
  42. data/test/dummy/app/assets/javascripts/crud/alert1.js +1 -0
  43. data/test/dummy/app/assets/javascripts/crud/alert2.js +1 -0
  44. data/test/dummy/app/assets/javascripts/jquery/jquery-2.1.1.js +4 -0
  45. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  46. data/test/dummy/app/controllers/application_controller.rb +5 -0
  47. data/test/dummy/app/helpers/application_helper.rb +2 -0
  48. data/test/dummy/app/models/ability.rb +35 -0
  49. data/test/dummy/app/models/teste.rb +9 -0
  50. data/test/dummy/app/models/teste1.rb +5 -0
  51. data/test/dummy/app/raro_crud/#{file_name}_crud.rb +0 -0
  52. data/test/dummy/app/raro_crud/pessoa_crud.rb +50 -0
  53. data/test/dummy/app/raro_crud/teste1_crud.rb +14 -0
  54. data/test/dummy/app/raro_crud/teste_crud.rb +58 -0
  55. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  56. data/test/dummy/bin/bundle +3 -0
  57. data/test/dummy/bin/rails +4 -0
  58. data/test/dummy/bin/rake +4 -0
  59. data/test/dummy/config.ru +4 -0
  60. data/test/dummy/config/application.rb +23 -0
  61. data/test/dummy/config/boot.rb +5 -0
  62. data/test/dummy/config/database.yml +25 -0
  63. data/test/dummy/config/environment.rb +5 -0
  64. data/test/dummy/config/environments/development.rb +39 -0
  65. data/test/dummy/config/environments/production.rb +78 -0
  66. data/test/dummy/config/environments/test.rb +39 -0
  67. data/test/dummy/config/initializers/assets.rb +8 -0
  68. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  69. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  70. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  71. data/test/dummy/config/initializers/inflections.rb +16 -0
  72. data/test/dummy/config/initializers/mime_types.rb +4 -0
  73. data/test/dummy/config/initializers/session_store.rb +3 -0
  74. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  75. data/test/dummy/config/locales/en.yml +23 -0
  76. data/test/dummy/config/routes.rb +56 -0
  77. data/test/dummy/config/secrets.yml +22 -0
  78. data/test/dummy/db/development.sqlite3 +0 -0
  79. data/test/dummy/db/migrate/20150415214253_create_testes.rb +9 -0
  80. data/test/dummy/db/migrate/20150416220930_create_teste1s.rb +10 -0
  81. data/test/dummy/db/schema.rb +31 -0
  82. data/test/dummy/log/development.log +11980 -0
  83. data/test/dummy/public/404.html +67 -0
  84. data/test/dummy/public/422.html +67 -0
  85. data/test/dummy/public/500.html +66 -0
  86. data/test/dummy/public/favicon.ico +0 -0
  87. data/test/dummy/test/fixtures/teste1s.yml +7 -0
  88. data/test/dummy/test/fixtures/testes.yml +7 -0
  89. data/test/dummy/test/models/teste1_test.rb +7 -0
  90. data/test/dummy/test/models/teste_test.rb +7 -0
  91. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/-0RkuYMXJCukyo6fA0YmSXUwMd47QpzpUhQatZpEqkY.cache +1 -0
  92. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/-AtorCA2iqgAMYxvH7W0eRa0fsPWw_adQ1E2a4T-ncs.cache +3 -0
  93. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/-MzeH9Nm-DG1fsBzYAO6iyo-dqHmHQD5JQiC725Whko.cache +0 -0
  94. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/-fEzfBEg4v147_Xfhlzq6AcSNGSYcxiMFDcZiY__4qg.cache +1 -0
  95. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/-raUXfOtrQirgvak5TOJHfEFDLcORHoJWFVSkL2kFLQ.cache +3 -0
  96. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/-rj6TLs6ScHy9rBVR1FtAG7sMhFwBhL-h_ql0-fjoO8.cache +0 -0
  97. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/00RruQPZ9NMEjxmmNLv-brb7Dz3JIcMmqznNLCV_eBg.cache +0 -0
  98. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/0zYv6B2AICV6CQqG9xsbhg0q0zgBEqHmqYT_oM2t63c.cache +1 -0
  99. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/2R9HI_ug87lStS_VoW5EAjaLi9vK_6V7QD6kCsr8i0M.cache +0 -0
  100. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/2WJz14KMpvhFJIFov0mbMmTKFGtCLEC36x7lVjzq87U.cache +0 -0
  101. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/2WRAXn1FZWe_1EQTP6dnelRkMOSABdpw4I1BgWO87UE.cache +1 -0
  102. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/2_CA3YFYuY8rjSK2fn5wiT8aepkp6YGqTYOjRurC220.cache +0 -0
  103. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/3PB0fIDBf8wgB_W12ygFqvjqAlXcuHtoolp3A2Qcdsw.cache +0 -0
  104. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/3plMbIHZMFJHbJTBWe2g7SenboxXqlxzU8aI900m22E.cache +0 -0
  105. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/3s3k0T7lXZyr84Rkm9J_VXqLwYW_I4_hXj7FOH-zfLM.cache +0 -0
  106. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/4B-h9SsGXeh2w8VQGniJjUysS2w7rO8I5c5JSUzp08o.cache +0 -0
  107. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/4COj5bJqFYUkKXUEQ47_DmXTi6Ac8IsStYYK5lo9LWc.cache +0 -0
  108. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/4Jm4uat5-HtEtboNSBYcPmZcwKBKYzcBa_DasUL3qNY.cache +1 -0
  109. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/4rTGqQYT_JbF0LetrygDgyPCH9is1SatjEQe-8k78so.cache +0 -0
  110. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/50IW238EtzEH5989d0XdN803CNIGp1InvXlIAU1HM40.cache +1 -0
  111. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/5s_bVndzZYo6nm7AZyOJxU4x3kvhcKsyqIKfcC_2Iu0.cache +0 -0
  112. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/6HYdSeJp0z3vfKTcO-NmYDcSJGsWpIRKiUQTx4wz4hE.cache +0 -0
  113. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/6QgJZL40nTelMwpeat779Ykv-8Dth_sdqaRfkrNDhiI.cache +1 -0
  114. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/6RfXmG9hCd6ds3txAlhE3SWj0j606PtQi64RPEM-TcA.cache +1 -0
  115. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/6em5auU0KgFUqVS55AUI5FFNo1Yall5joJNTPh6cREM.cache +1 -0
  116. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/6kJYp3x1cBZDpDSd_3XEOz6ifWEwKOE3Gb5z5Zoxt84.cache +0 -0
  117. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/74SkyQLF_kk_zAkQfJT0erg9zkZ6Fofeu05Fexi2a5w.cache +1 -0
  118. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/751lrK8ccX2v0VkMqF0nY6eMMFzmjQ0l3vatKsjPoG0.cache +1 -0
  119. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/7Gyv818zzArjMYxSFo6BCf-PRW6AYStsOd4xLRmF8hU.cache +0 -0
  120. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/7qXrvz_aUAoXT6FIX0DxsF9CTccT5fksyglG-DHDMfI.cache +1 -0
  121. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/85H49xavK_2TtUGG0BAapvIqdyry4-7eH0f99YabgSc.cache +0 -0
  122. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/8a2Q3fVjuE3Z7z0R5agncr869C89Cummxep05-u4UWw.cache +1 -0
  123. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/9AVKXW1Jc3ILufGozaIo5yvFLEaPS_zAwfHbO__usIs.cache +0 -0
  124. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/9WjO6_wu3g8yBTUfXWpOlu6yDNz-nACKkeuVxV7TSuo.cache +2 -0
  125. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/9oqzZU1KzLnwoLPfmeAx8oMfMdXsnZpq-jZB5-rNYqQ.cache +1 -0
  126. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/ALbGYuKATYSyElK_JYkccwgBRS3Lx61h74toN1jliI0.cache +1 -0
  127. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/A_Q5nO455RK-6h7qFBGx6NtGhbVJORpYvJ4RZs8RaeM.cache +1 -0
  128. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/AdReWx5s_03lXymktcB3CMl6CTKFus2HTcOJvGhdCUw.cache +1 -0
  129. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/B0rzMLMi8Ci8Q47RmCw4vHizwKPwIAeNjvGEb2qJbzg.cache +0 -0
  130. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/B6oh0lsvUcgddWUpcJhGWeson5WKq9oXNm--8MbrOWs.cache +6 -0
  131. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/BBUbO6W8N9-HtTfZjgASnsqBUePYt3-1RHFFp8u0u5U.cache +0 -0
  132. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/BGf7Y0SyTPz9Ydt8hwJRXQ4EroI1gI107ukxlevk5Z8.cache +1 -0
  133. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/BvU-skW8wL4KmDFzH8XT1gUWXo07dmQ0FoB8M_8bofA.cache +1 -0
  134. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/CUl-GCrcAiBnZAR6OPR1vtmvZvPqWWAdLZMfIPZJYb0.cache +0 -0
  135. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/CceiAev4oDf3En1JQCOEbxL3h03YbKFxFDc0hV8KUgw.cache +0 -0
  136. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/CfAlr2nebJ3Kl-Lcydx5d7Yv6iRRelwdfXmVCp27BEY.cache +0 -0
  137. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/CyLoGmEoSwmAeobjNGvGhebq_-s3ejljxrVV6czKqSU.cache +0 -0
  138. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/DF6ikykd1zv_eO5SEGyMxuxwd7mBtZNnk1kojMCscA0.cache +0 -0
  139. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/DMuQdFrhOQ6urUFtNTl6rJJqcaNloLms8jg1Tf5pUhY.cache +1 -0
  140. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/EdhOx5YJzUYE7Ys67yOzg04iV1LoIkN2C3J-V6Kd7kA.cache +0 -0
  141. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Eoz00hNTX8KygNr0aVpIEbh34MSEDX5m7ZqR8Lad9OE.cache +1 -0
  142. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/EvmXBcpSJlMPk0SMVRVNxX3HOkhFyF-hmBynvhH407Q.cache +3 -0
  143. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/ExITjXq3B3I4D2iPC9-7bWBMQMG067_pNyr51yzERWg.cache +0 -0
  144. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/FuxdU4c7Xc6cHVNpEbfk4KCJYp6NKj1jD1LvHQr87G0.cache +0 -0
  145. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/G1BmAqwKmBzIzvmqHrnas7bseYPySeYy_kKQUCudyRI.cache +0 -0
  146. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/GtlaUxUQN9roRptWCK4bcibWSGXX8YZOUL7rv6A3bMs.cache +0 -0
  147. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/HM5akuFqjvooR5YQPelVy9Gp2DEIXBhbCtXtEJe_Gw4.cache +1 -0
  148. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/HVGc6yBzGqr8JZ9wVVx9DwuAoB62xqX5o7-7GF8_D2k.cache +2 -0
  149. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Hp2z2qsfAtIig0amAkDdPBx8YTqC3eI6i13chZgIP84.cache +2 -0
  150. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/I3WA6ZiWG-zuR5mSSRisBfw157kRwx6rq6lCw0GvJuc.cache +1 -0
  151. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/JS4ML3ziOZ-0gHe13rM5fwAREuPNrJ-gZFjO3srZStk.cache +1 -0
  152. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/JXCGqqJsYbeS4osNafEUotYV8g2yH-okmlCShN2_skY.cache +0 -0
  153. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/K7qFaWBvn05qTKLldfHX3OEFRM776XCtH2oKNpbwkVE.cache +1 -0
  154. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/KEZbyOpyYalySpkvic4ZC-V30PpSmlS7hlnkzTIVzcI.cache +1 -0
  155. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/LPXp9MfnAoNxpQnHzcYEg5vRityYS8YU3catMirmhE4.cache +1 -0
  156. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Lz31lhNAZRtljaFrKzzDxo9anoBL4UXf0b6qSu3ixOg.cache +0 -0
  157. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/MAV4GtRsTNuMa7mh-FRGi2wL9z9semz4ipA-taBAp4w.cache +0 -0
  158. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/N25GQGIWXDow0UJUDlGjYFTg8_UB925vu960hWdxlSg.cache +0 -0
  159. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/N2Kc4daD17uXszWGiTWCpGWU7uIclgJ1QRaAdY5Zg1M.cache +3 -0
  160. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/NFE5HSRPELMk2JjUOBW48fPksAlUV8kIVYmdAeSryl0.cache +1 -0
  161. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/NkWwgnvgSUOGryPKuNnkQb37Udk1rbSi61oM7hFbS-0.cache +0 -0
  162. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/NzbuktItre-lQg5qhPHMdUL0ZwJLhELLqjL7Ak6yoE8.cache +0 -0
  163. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/O3U8kR_sGWfEYOfQtUzA9R7yWGaQeHdWnTMBtHOCqK0.cache +0 -0
  164. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/OPYstxXigozf6p1NcN6nFnBUONF9Crz_2Xe3N4N4-tk.cache +0 -0
  165. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/P2fhx18EfM52CRdcUcVblqJ3-2-kPkAqnOJfuBgNUxw.cache +1 -0
  166. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/PHuB8XHtS6zagW6bl1nAke04twK5oE_0P7MdUnhrp7A.cache +0 -0
  167. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/PhQ3QEw8R2R0F2G7n62dm5Nj10IhS_GSAIG82MvXc7c.cache +1 -0
  168. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Po2LrqIRsW1B-1hA6ydI-Rt_mpx2pXBac66EN2hhshA.cache +0 -0
  169. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Pv_TicOezYHAqPrhipb0dtidBfvIzfu-rjKFTW3yl1I.cache +1 -0
  170. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/QJefgE9eLObDoOA71vu5TV8kqFobztSkhB_mw7H4_-Q.cache +0 -0
  171. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/QcXaJ4--BWzhpQD7doOhC-SygbDl5oyf-HOuVprksh4.cache +0 -0
  172. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/QogVK7Zl4bvRfOdAM7ZsEkUgbV84BW22FN5WPi1Jhm0.cache +1 -0
  173. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/R5HsD0POG0xexSuYEwLy2ad0x3hBHFusyes1eRU0N6Y.cache +2 -0
  174. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/RAlAgkJK39zk8mrzAiedu6RIgni7Ca95CDYewbIyqyU.cache +2 -0
  175. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/RlHMp3gZ1aRTediB9KIBC-JNz3IXwShkqClSTt4gH7Q.cache +1 -0
  176. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/RrimogpCYT4gLOhSxEP23MTWQKLes2NFZauoPVBKoh0.cache +1 -0
  177. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Run9n7a73bx1qzBABFw705w_RTLh2hDFRZ1pxxX5A9k.cache +1 -0
  178. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/RwKuSDjm7JYYkbvfOLdCGgzeIqDJw8UkcJXHv-PCaw8.cache +1 -0
  179. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/S1P584VolTNZh4Ih05tAW__rYq64a1bPJy4Ku_MekC8.cache +0 -0
  180. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/S8qr6hNqBkDfzk_M783TIbmCgtyDIA6x9uW5TONaP-w.cache +1 -0
  181. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/SJ3EEmIti8GPIgc0WexzzMn6kEEZ0t9kpzifJsADKVk.cache +1 -0
  182. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/SNJD-4NH0aXPJecBz7iofpNPHR217ufNeftApCooPjg.cache +0 -0
  183. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/SUgEmzuKRgYzQPBAVtWz-hBg99Riz9wLvi6aHWnDEwQ.cache +1 -0
  184. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/SfnKk1dQvf8qIKaCdUsVa2cjOtgM_Xj6NQcYfy80Ck0.cache +3 -0
  185. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Sxj5zwmBihDy8UhTHtImyrN1_KKkcla1d7JDVKuYip4.cache +0 -0
  186. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/T-2u3VedKGzdLVQKVEWEPTlTfZp5VNvqcVJES9esUiQ.cache +0 -0
  187. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/TCXLy1tuwOhuK--MGtxXQFDTVo0EzGWm7SmJL2DebN8.cache +1 -0
  188. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/UCn-O-RZ6clYhkVyWgHMWglyAPFouB_VaQVDJrL9Z88.cache +1 -0
  189. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/UD5VPXqQzQVdXxBKbHriF6JCw8Qb9i7UE69lCXVN2OI.cache +1 -0
  190. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/UKKkjAe9vIzKz6qCsd0eyqIvSip6qtm9-YQbKZ-ze1Q.cache +1 -0
  191. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/V39AXCaEZmT-kOlIoZiCD0AyP1s7Xu7p94qQYQAt2s8.cache +0 -0
  192. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/VJtHFSLCtAMr7n-S0iAcXJuEeWLSGWr6HHdKJ_BbQpc.cache +0 -0
  193. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/VkKNjTO7kyAVClPp7bsHvVeLtvERoW59_A7Uo6lktlY.cache +0 -0
  194. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/WIXMTWvd2zBvQTEEpe9iJeFWW3lknQM0WLaB9LxMfg4.cache +0 -0
  195. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/WNYt-1VbjD4C9NEaYRJP1zlEmVzYt0ZIDESu5IcpMTU.cache +0 -0
  196. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/WX9tkL5_hG-PV_IQFjT26XsvSWhf85ZXv0nK2tBarGM.cache +1 -0
  197. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/XB4hg9UPbd45TylzMYymCymRnR7JxkQMpfCkeOT-3j0.cache +0 -0
  198. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/XQ4aIm-_RQNLlv_p-dZByJg8jsTS6LZs6lFARh-xWt0.cache +0 -0
  199. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/XikcGw0VNsR9odl0TNFSH11KSaRXARhXT-Ikb44Kr6o.cache +0 -0
  200. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Xu95SO3OK8xHiuD7VNZIsN5kLyB7ZLoOaSppRnpa2L8.cache +0 -0
  201. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/YJFZ_DgaJy6oEgEbRNYq_xbT5hg7Eu1h3WM5JPo7rdY.cache +0 -0
  202. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/YxDHUFE7wdRHeXKHLDmwSwz4fl9RkdIDtzeS8cnAyIE.cache +1 -0
  203. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Z6u7GBxS_lJQoT58OLOlQ45pyYfRR9Cv3hTyfbLYbjw.cache +0 -0
  204. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/_E5NnnUabpFFzkAQQ0RUiN4_5tRCHxdzu1_My4tw6IE.cache +1 -0
  205. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/_tyOMUndB2DVeq9nwU8pRQ39CkAU8lLzlFSrMNf_S3s.cache +2 -0
  206. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/a1AuugcwlWVX_ZnsaPnA4nvs_I74k_1BrwyftiVO7a4.cache +0 -0
  207. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/ar7XJXwMY_jRPYT6bfHpiMHlM8I4blvXzDgIZ50aMoE.cache +3 -0
  208. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/b-4ZOkjwvbGyC48dHtxES-yjISuUiqX-MPIZBgVu4iA.cache +0 -0
  209. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/bLSqdfBxS0hG8iE9YGbz6XcdnT76l3bqqbH1j-8VYMs.cache +1 -0
  210. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/bM42Ou_AvvRvhSpuZqF7sPrYdGg-8tuEwQ14R4YpJDQ.cache +1 -0
  211. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/bO3GaNycaPsLp3vX0Bgw7LYjlecep0FefE2Wsg2LH6o.cache +1 -0
  212. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/bmIthijT-qXHXtpDdnJPqADbj3aN2WcF-niJo-CW6kc.cache +1 -0
  213. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/bslCOFLEjB4LrqrjRzN4iOo3XJzXCUgaZRWI21lyOcI.cache +0 -0
  214. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/cei-NTbQTYBnfaLXMg7W6WJtPBQXucHzybQzztHfPek.cache +1 -0
  215. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/d6lfgb9qmUmGi5Ky9sB1L0FXLN_zXO8y-0eDtIMPmI0.cache +0 -0
  216. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/dVz07HiNkWxAeWuyadttjZ8gjJERJ4-RVt2kfFnPza4.cache +2 -0
  217. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/dlTvwgYuIwoWEZGMoujEUgkC4BpMgcX27kQjRdUgHuc.cache +0 -0
  218. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/e1WZZp0R9rj2aqI4sqtaPoR6rPwIcIhLCDZW6RJSKjY.cache +1 -0
  219. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/enSxWB88Tfl_5rIdKRRR658oDujh_E7di20GL-1ZIS0.cache +0 -0
  220. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/f0dWb4ayOVY6BW4NdPUh_ZBZDm31umoKULCxP7JsSeQ.cache +1 -0
  221. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/f8kJ7icPeFCN4AhIHCJUkizUReVZI4BJH4IUfaixE2w.cache +0 -0
  222. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/fG3BvTkCrakUd3CVBYY8kHi1A8Yv2lcvbLtUmAVlCoY.cache +0 -0
  223. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/fP_fEndiX1YdfVxwuEQsbk2nFv5nvBIY2eVVrLbAVfk.cache +1 -0
  224. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/fk6VEJiGQHxr9GVfpsjW5O8eixvxYj6LMFxzQrh6Xkk.cache +0 -0
  225. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/frnU1s3KmCm5DwyiZk1bFaApN7XgeMPSviilEaAqTig.cache +0 -0
  226. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/fvlVm0klEuWZekWgCSvDLOGw9peTpqOIwmACHsSwtL4.cache +0 -0
  227. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/gKpBPMi-T0qbsZWmO2mEuO1rR1tnI67HkR7fV5-MiKU.cache +0 -0
  228. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/ggkncbfz1SC-5i7rp2QXjHn-SPQYv-c2oaJTP4kl3-Q.cache +1 -0
  229. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/gyxR-VFHc3_dn9O9lS5SqQK_DXawjrt4H8PMI2hV-So.cache +1 -0
  230. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/i8KeXclJwkLX6gr6Vr6L_wdN1c429kOOUakNGccYIWs.cache +1 -0
  231. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/iJxOOx5Xnu8h5BXQzcUgfZlrfKPN9k-Q8dy3EwIg2Dk.cache +6 -0
  232. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/iUBSNc-5E5E4cN6X25OxX6APuzCtcxlfYazpNqhcQFU.cache +0 -0
  233. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/i_me0DwVwcfHchaKe9FFKjwORU_G61cz1heJSHNC4i4.cache +0 -0
  234. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/isPH7sBbG8wW0XpIU8w2JiRFzKmqpb0B3PtfjY-Fju4.cache +1 -0
  235. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/j10VJq1uwquWfiehjlw7kyrv_W-Gui-hrZFhaPVbzI0.cache +3 -0
  236. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/jHE2MSq7IKoXNMSSFB-DwZ8aKQvd-R4CPVH7K0q27_k.cache +1 -0
  237. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/jRxj7keJ-TAUqhgV0FvFYkM-p6pXRilTBNt7Xh1VX_E.cache +0 -0
  238. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/jtifSOVyGP_LNOAtPAUbEWNhcPQpnWTVp7lvyMvOnLc.cache +0 -0
  239. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/jyvcPE97vy_b-82NOzpqEX5jeTagB1kN4W1Wp45i4uk.cache +1 -0
  240. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/lAsroOrUZ4A2g90xX5jCzdRCYREw6VKOj0xBIJYMiGY.cache +1 -0
  241. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/lDe8sNEstNhniLIjHzYf_vHQjlEQV4qH-REZVOMOjFc.cache +0 -0
  242. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/laBJzx_b6JUB8MPLlFlxbgN_xkef7mGv0WN4tQIO2cg.cache +0 -0
  243. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/m4ZJqBa8y36aVwf3N0mF0-3RtnYRQCfqbGQJe-Lc_5g.cache +0 -0
  244. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/mYMDaxAPAJM8ErG8TXvZQxol46eqK3AV3CQ8G8V-b4M.cache +0 -0
  245. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/mxschIrqaPr6xevnPQT5ef8ZeaIgUSQ0RADbaMREQEA.cache +0 -0
  246. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/nJboFt8klA4zcXScAuBNJoSmGktbcif8nSSeWpLUEMk.cache +0 -0
  247. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/nOYKNZpj5-0kIhxeV40X6DsgyL8S66Ahhg66h2JBKG8.cache +1 -0
  248. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/nPoU98hJn_xwYkQDLg-VGhLzDs24XLcwgcX65MBQE5c.cache +1 -0
  249. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/ntqZkzoIE68aMjuc0yp-tmVqAc_-5xq69ePuaKaQOso.cache +0 -0
  250. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/nuc0ksGFSHVwsH9Sqi7WP_LJbqW_IjT6_XkDrdX3MjE.cache +0 -0
  251. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/o0W3V7MDQHortA5GOSC6ii4M6sUqp5lzzGlW7DrNHsQ.cache +1 -0
  252. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/o4N2GkOe3km73jRtXr6g1RhVtqBHmQXipLQSccjjics.cache +1 -0
  253. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/ogvxFdj-oDmf63tOXEM5hp4plavRvExl8Qnqap8sW7k.cache +1 -0
  254. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/p2enRakkRzJyMpSAJawDAE0o_OBSrSIa7KdUv-lcMow.cache +1 -0
  255. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/pHanFOUjaiuOlFtAv0dzy0MwMv_BuFtRR8JTcYXg2XQ.cache +0 -0
  256. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/pQziWwowuowx0FOYx2HAk84JbNUZcALmDixIYvQuJZg.cache +1 -0
  257. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/pS0_jaasn7nnwtSdY5bIvEr-P6DaJU7HsyH9sFKE0GI.cache +0 -0
  258. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/pxF_aFjVSm677g7jSkzExURX9cgPazYDabFXsta4Txo.cache +1 -0
  259. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/q4l5PLa8Zl9VK3e1PNYVXbSB1LW6ayfSq7YYMUSbgcU.cache +1 -0
  260. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/qKd0hTNCpbPOAgI3T6Om735FkvgjPnpGRPrMP2z0k2c.cache +0 -0
  261. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/qTqEguBBn4OieaN6XlRehOzjelVJSOsfcjfNKSBi_h0.cache +1 -0
  262. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/qc1z_lojge7OJ0N9FLjaFenXsN82iIEnKN5S-t_sBlU.cache +0 -0
  263. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/r93DDvPtjPyZa8taxSosNNvvOyHtMsF_ngrSs31aHOY.cache +0 -0
  264. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/rQM71yPXAdtASPadnfu1m7F_gQOb-uh_Adxs5P55R7U.cache +2 -0
  265. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/rbjKrg9BdrF2KtWN35sVH9aZOwvhLrEdX1xsyaYpxEM.cache +1 -0
  266. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/rcIDrjXwMeotIKYDncG2DGA50sE4HAYSUVSEYT2_VIE.cache +0 -0
  267. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/rtP4xELGID8pEJo_BvmsxpiYVBxvMCLlvdlJUvUgqEg.cache +0 -0
  268. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/rykyMLrVFRiIIFUPH9OmnTjB-rUqcfXIXnpn5BW9Qm8.cache +2 -0
  269. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/s4TQBqPusIoFIDSX3E4KAuPCuQDQojW6slN6AoIJJ-U.cache +1 -0
  270. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/tZ5iPXN6G9X1ixL0WHs-uh5VAqziiY6UW-Z2hvUF6Yk.cache +1 -0
  271. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/uWSNrNOkPR4BhWrOxXX5TfqNlJIbszyfZtHnTTKZ9cg.cache +0 -0
  272. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/uduw2awKAS_DPp9gklbfvv2RDev7wEpenbCFDA4DNxs.cache +2 -0
  273. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/uzyaJavSCzdPUOHA5GK3am45IFBayRibD2aAssiJ38M.cache +1 -0
  274. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/vVrp5o_oj54K9Spnx5HkfJ6ga4Tm7GxFZKt4WZB8FIo.cache +1 -0
  275. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/vuecJc1nwUoDltWHnzMRV85v7LwdiSgS7ZxysZYrRdg.cache +0 -0
  276. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/weIC5cXLvacNNF25heFbcWBeOsb2iQ-7WcBUahSrfEE.cache +0 -0
  277. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/wvCRibnMjYfz4MGqnbW1nweqNRiPm4ATaK-ewK5ssOQ.cache +1 -0
  278. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/wyL3h6Marl2JMfZYLDwQkXRdK4NuLKiCWHQm6igReZ4.cache +1 -0
  279. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/x0Q5Wf3UaFu2wIgP9JPFAVuYUi0n-xY58FuBZ-0O2xI.cache +2 -0
  280. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/xCb6Q2JAt2SWDS5ibOqetMJWKJm1BdJXdfAdLfLXYVc.cache +1 -0
  281. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/xkckYJjDSntINUKHZDIlrd09lKxhlFZdN7bT8Q0E1iE.cache +0 -0
  282. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/xoHo4y-EuHmK9O3z662PKRsIZpkyFW4KFE0JA6Bp3w8.cache +0 -0
  283. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/y5iLcw4EhWkb07ULRjXL7JsXk9-lj40vgPx1f3nlXeY.cache +1 -0
  284. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/y8ezrzwP5d8BLJ61T6L_Q4pitouvrbICokHEnxXC1ao.cache +2 -0
  285. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/yAZJ5fnLUjXfVQXlEOoO_EszVleGJC2-Lg6z7_9KvBI.cache +0 -0
  286. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/yThvUcySW81LnX3krwb-Uhi7OEIn0LrQo5jJVQxm-N0.cache +0 -0
  287. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/yXXUoKEykhpZPMXWVzUf3GtTwgAtNSDCOK6TvomSdoM.cache +0 -0
  288. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/zsJ7Mb8REasrj4nUuq6H0d0o74xxuUlQk7KtCJSdqMg.cache +1 -0
  289. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/zwqXp6G2mEvMWMFcZeiFfb2jr3PymMGXDPQdfjBCrR0.cache +1 -0
  290. data/test/dummy/tmp/pids/server.pid +1 -0
  291. data/test/integration/navigation_test.rb +10 -0
  292. data/test/lib/generators/crud_generator_test.rb +14 -0
  293. data/test/templus_models_test.rb +7 -0
  294. data/test/test_helper.rb +18 -0
  295. metadata +693 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 23badb12cc244b3fc149ceb4dcd12df3412658a0
4
+ data.tar.gz: 864d9865414aa5084be850edc9efa547cc52394b
5
+ SHA512:
6
+ metadata.gz: 1545baff072e5414efea8b01402212e03f508b5c4e460cd83c5a989f0c00da4a3d7489197de59d502a15f1d0a111d9b8a58bb2de298b224278aa6f461cc3a8ca
7
+ data.tar.gz: ae3af54e2b7ced0246a97b19bf189f14b225bff89d5b46a814df162047516982baf246553553b159c764b36d152563d4fa8b99377b6f3e8d5d07f98316dacefa
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2015 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ = TemplusModels
2
+
3
+ O Templus Models agiliza a geração de gruds em projetos Rails
data/Rakefile ADDED
@@ -0,0 +1,34 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'TemplusModels'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+
21
+
22
+ Bundler::GemHelper.install_tasks
23
+
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'lib'
28
+ t.libs << 'test'
29
+ t.pattern = 'test/**/*_test.rb'
30
+ t.verbose = false
31
+ end
32
+
33
+
34
+ task default: :test
@@ -0,0 +1,95 @@
1
+ //= require permissoes
2
+
3
+ function atualiza_campos_crud(){
4
+ $('.datepicker').datepicker({
5
+ todayBtn: "linked",
6
+ keyboardNavigation: false,
7
+ forceParse: false,
8
+ calendarWeeks: true,
9
+ autoclose: true
10
+ });
11
+
12
+ $('.i-checks').iCheck({
13
+ checkboxClass: 'icheckbox_square-green',
14
+ radioClass: 'iradio_square-green'
15
+ });
16
+
17
+
18
+ $('.raro_date_range').daterangepicker({
19
+ format: 'DD/MM/YYYY',
20
+ ranges: {
21
+ 'Hoje': [moment(), moment()],
22
+ 'Ontem': [moment().subtract('days', 1), moment().subtract('days', 1)],
23
+ 'Últimos 7 dias': [moment().subtract('days', 6), moment()],
24
+ 'Últimos 30 dias': [moment().subtract('days', 29), moment()],
25
+ 'Este Mês': [moment().startOf('month'), moment().endOf('month')],
26
+ 'Mês Passado': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
27
+ },
28
+
29
+ startDate: moment().subtract('days', 60),
30
+ endDate: moment()
31
+
32
+ },function(start, end) {
33
+ $($(document.getElementById(this.element.context.id)).data('start-target')).val(start.format('YYYY-MM-DD 00:00'))
34
+ $($(document.getElementById(this.element.context.id)).data('end-target')).val(end.format('YYYY-MM-DD 23:59'))
35
+ }
36
+ );
37
+
38
+ $(".sidebar-collapse").find("li.childreen").click(function (){
39
+ var menu = $(this);
40
+ $("li.active").removeClass("active");
41
+ menu.addClass("active");
42
+ if(menu.parent().parent().hasClass("parent-menu")){
43
+ menu.parent().parent().addClass("active");
44
+ }
45
+ });
46
+
47
+ $(document).on('click', '[data-toggle="modal"]', function (e) {
48
+ $('.modal-backdrop').appendTo("body");
49
+ });
50
+
51
+ $('.modal').appendTo("body");
52
+
53
+ $('.crud-new-record').click(function(){
54
+ var select = $(this).siblings().last().find('select')
55
+ var id = select.attr('id')
56
+ var name = select.attr('name')
57
+ new_record(id,name)
58
+ return false;
59
+ })
60
+
61
+ };
62
+
63
+ function new_record(id,name){
64
+ var model_name = name.split("[")[1].split("_id]")[0];
65
+
66
+ $('#modal_new_record').attr("class","modal inmodal")
67
+ $('#modal_new_record').addClass(model_name);
68
+
69
+ var model_target = "#modal_new_record." + model_name;
70
+
71
+
72
+ var url = "/crud/" + model_name + "/new.js?render=modal";
73
+ var jqxhr = $.ajax(url)
74
+ .done(function(result) {
75
+ $(model_target).attr('data-source',id);
76
+ $(model_target).attr('data-saved','false');
77
+ $(model_target).on('hidden.bs.modal', function (e) {
78
+ if($(model_target).attr('data-saved') == 'true'){
79
+ var entity_desc = $(model_target).attr('data-entity-name')
80
+ var entity_id = $(model_target).attr('data-entity-id')
81
+ $('#' + id).append($('<option>', {
82
+ value: entity_id,
83
+ text: entity_desc,
84
+ selected: 'selected'
85
+ }));
86
+ $(model_target).attr('data-saved','false');
87
+ $(model_target).attr('data-entity-name','')
88
+ $(model_target).attr('data-entity-id','')
89
+ }
90
+ })
91
+ $(model_target + ' .modal-body').html(result);
92
+ $(model_target).modal('show');
93
+ $('.modal-backdrop').appendTo("body");
94
+ });
95
+ }
@@ -0,0 +1,148 @@
1
+ class CrudController < ApplicationController
2
+ before_filter :setup
3
+
4
+ def index
5
+ authorize! :read, @model if respond_to?(:current_usuario)
6
+ if params[:scope].present?
7
+ @q = @model.send(params[:scope]).search(params[:q])
8
+ else
9
+ @q = @model.search(params[:q])
10
+ end
11
+ if @q.sorts.empty?
12
+ if "#{@crud_helper.order_field}".include?("desc") or "#{@crud_helper.order_field}".include?("asc")
13
+ @q.sorts = "#{@crud_helper.order_field}"
14
+ else
15
+ @q.sorts = "#{@crud_helper.order_field} asc"
16
+ end
17
+ end
18
+ if respond_to?(:current_usuario)
19
+ @records = @q.result(distinct: true).accessible_by(current_ability, :read).page(params[:page]).per(@crud_helper.per_page)
20
+ else
21
+ @records = @q.result(distinct: true).page(params[:page]).per(@crud_helper.per_page)
22
+ end
23
+ @titulo = @model.name.pluralize
24
+ render partial: 'records' if request.respond_to?(:wiselinks_partial?) && request.wiselinks_partial?
25
+ end
26
+
27
+ def setup
28
+ @model = Module.const_get(params[:model].camelize)
29
+ @crud_helper = Module.const_get("#{params[:model]}_crud".camelize)
30
+ end
31
+
32
+ def new
33
+ authorize! :create, @model if respond_to?(:current_usuario)
34
+ @record = @model.new
35
+ end
36
+
37
+ def edit
38
+ authorize! :edit, @model if respond_to?(:current_usuario)
39
+ @record = @model.find(params[:id])
40
+ end
41
+
42
+ def show
43
+ authorize! :read, @model if respond_to?(:current_usuario)
44
+ @record = @model.find(params[:id])
45
+ end
46
+
47
+ def action
48
+ authorize! :create_or_update, @model if respond_to?(:current_usuario)
49
+ @record = @model.find(params[:id])
50
+ if @model.method_defined?(params[:acao])
51
+ if @record.send(params[:acao])
52
+ flash.now[:success] = "Ação #{params[:acao]} efetuada com sucesso."
53
+ else
54
+ flash.now[:error] = "Erro ao tentar executar a ação #{params[:acao]}."
55
+ end
56
+ index
57
+ else
58
+ @titulo = @record.to_s
59
+ @texto = params[:acao]
60
+ render partial: "/#{@model.name.underscore.pluralize}/#{params[:acao]}"
61
+ end
62
+ end
63
+
64
+ def create
65
+ authorize! :create, @model if respond_to?(:current_usuario)
66
+ @saved = false
67
+ if params[:id]
68
+ @record = @model.find(params[:id])
69
+ @saved = @record.update(params_permitt)
70
+ else
71
+ @record = @model.new(params_permitt)
72
+ @saved = @record.save
73
+ end
74
+
75
+ respond_to do |format|
76
+ if @saved
77
+ flash[:success] = params[:id].present? ? "Cadastro alterado com sucesso." : "Cadastro efetuado com sucesso."
78
+ format.html { redirect_to "/crud/#{@model.name.underscore}" }
79
+ unless params[:render] == 'modal'
80
+ format.js { render action: :index }
81
+ else
82
+ format.js
83
+ end
84
+ else
85
+ action = (params[:id]) ? :edit : :new
86
+ format.html { render action: action }
87
+ format.js
88
+ end
89
+ end
90
+ end
91
+
92
+ def destroy
93
+ authorize! :destroy, @model if respond_to?(:current_usuario)
94
+ @record = @model.find(params[:id])
95
+ @record.destroy
96
+ respond_to do |format|
97
+ flash[:success] = "Cadastro removido com sucesso."
98
+ format.html { redirect_to "/crud/#{@model.name.underscore}" }
99
+ format.js { render action: :index }
100
+ end
101
+ end
102
+
103
+ def query
104
+ authorize! :read, @model if respond_to?(:current_usuario)
105
+ @resource = Module.const_get(params[:model].classify)
106
+ @q = @resource.search(params[:q])
107
+ @q.sorts = 'updated_at desc' if @q.sorts.empty?
108
+ if respond_to?(:current_usuario)
109
+ results = @q.result(distinct: true).accessible_by(current_ability).page(params[:page])
110
+ else
111
+ results = @q.result(distinct: true).page(params[:page])
112
+ end
113
+ instance_variable_set("@#{params[:var]}", results)
114
+ if request.respond_to?(:wiselinks_partial?) && request.wiselinks_partial?
115
+ render :partial => params[:partial]
116
+ else
117
+ render :index, controller: request[:controller]
118
+ end
119
+ end
120
+
121
+ private
122
+ def params_permitt
123
+ params.require(@model.name.underscore.to_sym).permit(fields_model)
124
+ end
125
+
126
+ def fields_model
127
+ fields = []
128
+ @crud_helper.form_fields.each do |field|
129
+ if @model.reflect_on_association(field[:attribute])
130
+ if @model.reflect_on_association(field[:attribute]).macro == :belongs_to
131
+ fields << "#{field[:attribute]}_id".to_sym
132
+ else
133
+ fields << {"#{field[:attribute].to_s.singularize}_ids".to_sym => []}
134
+ end
135
+ elsif (@model.columns_hash[field[:attribute].to_s] || (@model.respond_to?(:params_permitt) && @model.params_permitt.include?(field[:attribute].to_sym)))
136
+ fields << field[:attribute]
137
+ end
138
+ end
139
+ @crud_helper.form_groups.each do |key, groups|
140
+ group = {"#{key}_attributes" => [:id, :_destroy]}
141
+ groups.each do |field|
142
+ group["#{key}_attributes"] << field[:attribute]
143
+ end
144
+ fields << group
145
+ end
146
+ fields
147
+ end
148
+ end
@@ -0,0 +1,169 @@
1
+ module CrudHelper
2
+
3
+ def is_active_controller(controller_name)
4
+ params[:controller] == controller_name ? "active" : nil
5
+ end
6
+
7
+ def is_active_action(action_name)
8
+ params[:action] == action_name ? "active" : nil
9
+ end
10
+
11
+ def is_raro_crud(attribute)
12
+ if(Rails.env == "production")
13
+ @@cruds = Dir[Rails.root.join("app","raro_crud","*.rb")].map{|f| f.split(/\//).last.gsub(/_crud\.rb/,'')} unless @@cruds
14
+ else
15
+ @@cruds = Dir[Rails.root.join("app","raro_crud","*.rb")].map{|f| f.split(/\//).last.gsub(/_crud\.rb/,'')}
16
+ end
17
+ return @@cruds.include?(attribute.to_s)
18
+ end
19
+
20
+ def menu_helper_crud(modelo, url, nome, classe,icon='')
21
+ if can?(:read, classe)
22
+ buffer = ""
23
+ buffer << "<li class='childreen #{controller.controller_name == 'crud' and params[:model] == modelo ? 'active' : '' }'>"
24
+ buffer << link_to("<i class='icon-#{icon}'></i><span>#{nome}</span>".html_safe, url, data: {push: true, crumb: 'wielka'})
25
+ buffer << "</li>"
26
+ buffer.html_safe
27
+ end
28
+ end
29
+
30
+ def is_action_edit?
31
+ params[:action] == "edit"
32
+ end
33
+
34
+ def is_action_create?
35
+ params[:action] == "create"
36
+ end
37
+
38
+ def is_action_show?
39
+ params[:action] == "show"
40
+ end
41
+
42
+
43
+ def render_link(link)
44
+ "<a href='#{link[:link]}' class='#{link[:class]}' #{data(link)}>#{gen_icon(link[:icon])} #{link[:text]}</a>".html_safe
45
+ end
46
+
47
+ def gen_icon(i)
48
+ if i
49
+ "<i class='#{i}'></i>"
50
+ else
51
+ ""
52
+ end
53
+ end
54
+
55
+ def data(link)
56
+ buffer = ""
57
+ link[:data].each_key{|k| buffer << " data-#{k}='#{link[:data][k]}' "} if link[:data]
58
+ return buffer
59
+ end
60
+
61
+ def raro_models
62
+ models = []
63
+ Dir["#{Rails.root.to_s}/app/raro_crud/*"].each do |f|
64
+ m = f.split("/").last.split("_crud").first.camelize
65
+ if m != "Raro"
66
+ models << m.constantize
67
+ end
68
+ end
69
+ models.uniq.flatten
70
+ end
71
+
72
+ def raro_permissions
73
+ permissions = []
74
+ Dir["#{Rails.root.to_s}/app/controllers/*"].each do |f|
75
+ permission = f.split("/").last.split(".").first.camelize.constantize.instance_variable_get("@permissao")
76
+ if permission.present?
77
+ permissions << permission
78
+ end
79
+ end
80
+ raro_models.each do |m|
81
+ permissions << m.name
82
+ end
83
+ permissions.uniq.flatten
84
+ end
85
+
86
+ def flash_messages_for
87
+ tipo = ""
88
+ case
89
+ when flash[:notice]
90
+ message = flash.discard(:notice)
91
+ tipo = 'notice'
92
+ when flash[:alert]
93
+ message = flash.discard(:alert)
94
+ tipo = 'alert'
95
+ when flash[:success]
96
+ message = flash.discard(:success)
97
+ tipo = 'success'
98
+ when flash[:error]
99
+ message = flash.discard(:error)
100
+ tipo = 'error'
101
+ when flash[:info]
102
+ message = flash.discard(:info)
103
+ tipo = 'info'
104
+ end
105
+
106
+ flash.clear
107
+
108
+ if message.present?
109
+ javascript_tag "mensagem_#{tipo}('#{message}')"
110
+ end
111
+ end
112
+
113
+ def render_plus_button(field,f,modelo,record)
114
+ field[:sf][:wrapper] = :with_button
115
+ render_field(field,f,modelo,record)
116
+ end
117
+
118
+ def render_field(field,f,modelo,record)
119
+ if field[:sf].present? && field[:sf][:if].present?
120
+ return unless field[:sf][:if].call(f.object)
121
+ end
122
+ if !field[:sf][:edit].nil? || !field[:sf][:create].nil?
123
+ if !field[:sf][:edit].nil? && !field[:sf][:edit] && !record.new_record?
124
+ elsif !field[:sf][:create].nil? && !field[:sf][:create] && record.new_record?
125
+ else
126
+ unless modelo.reflect_on_association(field[:attribute])
127
+ f.input field[:attribute], field[:sf]
128
+ else
129
+ f.association field[:attribute], field[:sf]
130
+ end
131
+ end
132
+ else
133
+ if field[:sf][:value] and field[:sf][:value].class == Proc
134
+ field[:sf][:input_html] = {}
135
+ field[:sf][:input_html][:value] = f.instance_eval &field[:sf][:value]
136
+ end
137
+ if field[:sf][:collection_if] and field[:sf][:collection_if].class == Proc
138
+ field[:sf][:collection] = f.instance_eval &field[:sf][:collection_if]
139
+ end
140
+ unless modelo.reflect_on_association(field[:attribute])
141
+ f.input field[:attribute], field[:sf]
142
+ else
143
+ f.association field[:attribute], field[:sf]
144
+ end
145
+ end
146
+ end
147
+
148
+ def imagem?(file)
149
+ file.present? && file.content_type.start_with?('image')
150
+ end
151
+
152
+ def video?(file)
153
+ file.present? && file.content_type.start_with?('video')
154
+ end
155
+
156
+ def documento?(file)
157
+ !(video?(file) || imagem?(file))
158
+ end
159
+
160
+ def render_field_file(field)
161
+ if imagem?(field) && field.url(:thumb)
162
+ image_tag(field.url(:thumb))
163
+ elsif video?(field)
164
+ link_to field, field.url, target: "_blank"
165
+ else
166
+ link_to field, field.url, target: "_blank"
167
+ end
168
+ end
169
+ end