gdpr_rails 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/policy_manager/concerns/user_terms.rb +42 -0
  3. data/app/controllers/policy_manager/user_terms_controller.rb +6 -64
  4. data/app/models/policy_manager/concerns/user_behavior.rb +5 -5
  5. data/app/models/policy_manager/portability_request.rb +1 -1
  6. data/app/models/policy_manager/user_term.rb +1 -1
  7. data/lib/policy_manager/config.rb +1 -1
  8. data/lib/policy_manager/version.rb +1 -1
  9. data/spec/dummy/app/models/another_user.rb +26 -0
  10. data/spec/dummy/config/database.yml +1 -1
  11. data/spec/dummy/db/development.sqlite3 +0 -0
  12. data/spec/dummy/db/migrate/20190221193827_create_another_users.rb +9 -0
  13. data/spec/dummy/db/schema.rb +4 -33
  14. data/spec/dummy/log/development.log +443 -0
  15. data/spec/dummy/log/test.log +43784 -0
  16. data/spec/dummy/test/fixtures/another_users.yml +7 -0
  17. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-a/-aHQxwP06Q1l3SFvBIxMiQYltGHC1m8JxkYfDgYrLAQ.cache +0 -0
  18. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-g/-gjzp-ck2yb6Tdt89GKu6zXQ2WQKkhpSiJVFkbrB1EA.cache +1 -0
  19. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-h/-hlM1kR2vjOUm5WXoeZIHyodp0CoKRebRsO_NBtsoyI.cache +0 -0
  20. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-t/-t8f990sOfpmPQ4Z8vmOf6mEfDZ2yoWG9ULAHI1RZOE.cache +1 -0
  21. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/0E/0EAgLp4avByXCEGss-kYmNLhcq1TDHSA3tzzO3voKqc.cache +1 -0
  22. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/0k/0keLS7n7BrF1dW6jOPaZlLoMNgN0SdbpEz1hGQg6Vdc.cache +0 -0
  23. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1b/1bEROIwc5oQj23SZ2htz-UPdxilvNkK-_zO2enz89cQ.cache +2 -0
  24. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1r/1rL0_vhnXKflEHCIhayqGKvIahggn4OM32S-u9cldjs.cache +1 -0
  25. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/22/22qlopVfSb-NAprLkGvGFnrrGyT3aknPTd1mcr9n6iM.cache +1 -0
  26. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/2z/2zaQH3i5-H2sAGaNv1xhwKPIupojlSZsUhWxDle6dls.cache +0 -0
  27. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/3I/3IMIH0CnWgFKpGfyuz6cqr3GQqw5Kqr4FXeY2T4t2Ms.cache +1 -0
  28. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/3P/3PkdTX8Fs3jHWDVmgTw678B9TbL72pTiao-Sa14xQAE.cache +3 -0
  29. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/4k/4kyxn8Xl9YphOdLdBhWr_oNqL32lFejOAFviuHukNH8.cache +0 -0
  30. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/59/59CiVYAVFPtvleIV5bHPFieuEuNeWBXLu_pPlA_AU38.cache +0 -0
  31. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5m/5mO5S2MfbEUVxkXH46amJgMg-T2BHvPkW-PHDU1kP68.cache +0 -0
  32. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5y/5yHoqy9mnUxVO_i7ZR-K03kXQK-auoOt-eBEjU5OXj4.cache +1 -0
  33. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/6A/6AIzqF1gZnraQ1STmFh6RLU-Lxt6gmnLKOKd_b5mua8.cache +1 -0
  34. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/6A/6aYIoeQLvEzSfCg96v48NbCUftuuT8AtEkX9QZMqSW0.cache +1 -0
  35. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/72/726z-qbVgHrbQwjA24SMkQj6NC01NKV26LKL5YIEMrw.cache +0 -0
  36. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7J/7J4keF13Jv41wAmHnJtghu6FAyawJVTtonJ0-W3-rTM.cache +2 -0
  37. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7P/7PIUbRiV8Y8GWYRSWsdwmX44RmQMsTejd_b5_UJLib0.cache +1 -0
  38. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7h/7hZcMIiObzta3kek4vjVvIDlUxHE5zpJaz6IEbsKk_0.cache +0 -0
  39. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8e/8e4FRdl1DMMQtTXSFykJV9GTvmFlTDM33Wr2aQimDt4.cache +1 -0
  40. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/9-/9-OTYYYlxRuwJWIldQDi-9Fl_V3yAuvawsIbqh41DDI.cache +1 -0
  41. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/A-/A-6FMllBPcMUYEz2RuYEqpusM4sB1VYB-nr2pjLdxxE.cache +1 -0
  42. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/AI/AIRy1qewdSPu4KspUovTsLLWBUegd-Noyw1-CrJOxw4.cache +1 -0
  43. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/CS/CSAj2e_TLDqvgl3MRh-6RE9I841LoqSDZOd2rLLyfFw.cache +1 -0
  44. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/CV/CV6JVVdW1ZMxnoQDN54ivA-jQX8pXqRAMO0M9nbcrAU.cache +1 -0
  45. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/CY/CYjbcilVseR74bMqiNJQvYDEfhtXuiyZXgmnuUsGkV8.cache +0 -0
  46. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Cu/CuTGLxessomzqUukr5eNIW47zWSw2EcrkHjPU2T79Ss.cache +1 -0
  47. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Du/DUyo6-s7Nz9FkQCddo6QBemrhIKpLvgP_EQlVIvCMIc.cache +1 -0
  48. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Du/DusKbND6jVwMWGdbLHHFIXSn-VyGoaDFMzfyiRGa01g.cache +1 -0
  49. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Dw/Dw5Rv79fHl7RhN7UndE5QWTk2XxlGR8E4TGriK-fTRo.cache +2 -0
  50. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Dz/DzxYG8j_Hk80TSDytBYzhEh4iw2qgnThsphbRfb8Yo0.cache +1 -0
  51. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/FG/FGTqZQ-ICnWRw_FIx5roRi8IATSdS5OkwrMtS3XtXBY.cache +0 -0
  52. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/FV/FVo-aHKXwy1yxqSMJbkLyHPwRAyFujt9uxWXYbPica0.cache +0 -0
  53. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Gh/Gh11Op6cnd3BVM_BqiVDDFJMYQXzF1Rs0H85KKvS6gg.cache +0 -0
  54. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/H3/H3QsZsFck_eI2szqQIJX6m6CKepNHfW03O7kDjLp67M.cache +0 -0
  55. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/HB/HBAJM5iGpE8mygYQoQXo94iLywhzb50rXbxsp-0QFHo.cache +0 -0
  56. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/I5/I5hN3KZt5ivvrkpxjmtRV7IuDmIkCg7oIwzDmNiIcBo.cache +1 -0
  57. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/JB/JBRp7gYK7Am4VSpEA2KtgnJ7hUn_uWR4Efyepn583_Y.cache +1 -0
  58. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/JU/JUavCo99Fo8fIYH8WHAJW0VWKrwWxzX3SkQ6tVnqa8A.cache +1 -0
  59. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/K9/K9kikk4UzNAlj-ylS9V_SIXVh9akPqvgC2wmXLSKPWw.cache +1 -0
  60. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/L7/L7xnnxbChRgMZtzQzwy05Js412R7_RUgJg5FSuH_n4k.cache +0 -0
  61. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/MJ/MJ17_sTXgjjs1pZDWp0lj7tCTp9kQ6siEqPiIt0yeEQ.cache +1 -0
  62. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Mu/Mu1Oqh4YiJx7b3kXCVW0vmwspLRRCO76QR5CZ4hNCjg.cache +1 -0
  63. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/NA/NAkzU02rQDJYnKyMltEcsYO4LSTYpGAiYpADUzqbNVw.cache +1 -0
  64. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/NH/NHI6S815-hL6Dzee6b-DdCQZRvPmaxbOawD8EFc68YI.cache +1 -0
  65. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/NU/NUom7-2vYXd_eEJPYknrsAwAZ8wjIt7PYHRy5_IbFVc.cache +1 -0
  66. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/OW/OWzR1WGfjf6E9LsFGmqv9FjKF7tLnK91uhEw79KE-mo.cache +0 -0
  67. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/PE/PEjWR-I1zxRHtUF7gbBQ1Ek7DoXi1LdpgEd0DtAHDdQ.cache +0 -0
  68. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Pi/Pi3bAArV_H1E3W8ia0iNyPPhD5YJQ4508ZX7CzdKPQU.cache +0 -0
  69. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Pp/PpNVKBqdav3EobsJmcyre8lzG1wClMVj9j-2gmU2QRM.cache +1 -0
  70. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/R6/R6FpOoS6EuiKrVXgMbcjad3Ibr_VL2W0KYP47A7jaxI.cache +0 -0
  71. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/RF/RFIQgPTxjMCnNgoYLpS0zLAlSPqlYgp-yNLrpiT6bNs.cache +0 -0
  72. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ra/RaAeFkh66Icz5PuPcBMb_Kn4lKaFCxMKj3Mf5u0rJpM.cache +1 -0
  73. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Rg/Rg8-NBWaLbUxa3ffglccKpJoe3Qp62cXTBJf0YKOicI.cache +0 -0
  74. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Tf/TfX7CKxq9CGT0II7byr8IDUgkKUETRmyqd3UTh_q0w4.cache +1 -0
  75. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Us/UsdQRHUf-zrBnHLmAUGpqNF9-AcpT3ALFZGgMQudV0w.cache +0 -0
  76. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/V-/V-jtx_79ypXyz8ax35C8m7_j7yusZ11XHrXUA9z7XMI.cache +1 -0
  77. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/W1/W1UKBtf-STM8xlySkcIx-mG8XFQ9ajXmcF05Ltisu0I.cache +1 -0
  78. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/WL/WLQS2trklavDjrIyu36sVxonmT5JolxoyuE45epHAdw.cache +1 -0
  79. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/YA/YA3wOiaLDEYoaqT5DFTqyfKYTjY_rFd14qGwFOPMTZ4.cache +1 -0
  80. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ys/YsT84heq92j3foWlXO6byYWcCudufPlS0Oq-EZnduXs.cache +1 -0
  81. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ys/ys3mA-zRRUGP0S4iTcKx_RonHf_WAQp99ZGpkNQwvzE.cache +1 -0
  82. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Yu/YukzgTJTB7k2Fwy2rMGCD8hZY90GFYlbkAT4YmW_UYE.cache +0 -0
  83. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ZB/ZByeGqvssY6UTbq1m29fzJrwC_P4U10nc_zXYXqUSSg.cache +0 -0
  84. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ZU/ZUvhYFT9e0Nd2rmhFfmJWeAW5fijeeZMO1NbJ3qi8pg.cache +1 -0
  85. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Zv/ZvZwK5ypI2yuEEbYHYJl1co5hGUZ2tRDWwF9JwfQM_c.cache +3 -0
  86. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/bS/bS3iC0H4_Ge-r9Sbi8YcH91uja7SfilnJfetBOaFrDw.cache +2 -0
  87. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/b_/b_Itlk9QZZd7Rvf8kcA4yLP1R5Acu7jB-m1xQiSU0qE.cache +2 -0
  88. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/eB/eBlG7T8TAhmoTaPohjEANUNiW0UHMQZXnmITm4gJimI.cache +0 -0
  89. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ey/EYjFXzqqLtiodZKUuOD38psN3mbJhkiMNH1KMJHtjVg.cache +1 -0
  90. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ey/eyvM_HCZA_hlXW6K1xu6P9_Mea3gLMQBwVbUxWA6Ttw.cache +3 -0
  91. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/f_/f_i36Hmu17xYcpc3jDVCAzykva6KquwYGdqqLgRwiE0.cache +0 -0
  92. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/fa/faPn7B4zieXAAvcPec_s0FA6FtbAXXk114vv1ojuGUo.cache +1 -0
  93. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ft/ftJPgTPp6dnElMFIzpHJCUikKcpFW8db_yZGUaZ_W70.cache +0 -0
  94. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/g1/g1u_oGi3pgA-2uAtIqn3G9Fu9DnuCCIt3cMsn-a6iRY.cache +2 -0
  95. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ge/geIQ-vL4sRcpZWAUIm1GWhS8A1_YU2ndjIdVJCS-Uvo.cache +0 -0
  96. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/jC/jCh_R4fzgyGAxgZmG717sTbhYTe2-p-EA0Wtj1Y7UbQ.cache +1 -0
  97. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/lg/lg1ExD6zq_Fv1Ht71z2B1MwWlhUeyq0rAT-gP_8-37c.cache +3 -0
  98. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ll/llIDdeIkmyURZ2DbBvGx9ELYgC05FPyZaiMs47zl_rI.cache +1 -0
  99. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ln/lnkOHZjj0qN0wjdDTqISbwi3rpVgKphccVPphNphEzY.cache +1 -0
  100. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/mX/mX1nlsL_SWOB4y22W5FheRX0YEONKyOY7xUeIvRiHco.cache +0 -0
  101. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/n_/n_xYqQYhwEMQknb3jFQnjlxxBE9TzMNHCdJ-bEyZFIw.cache +0 -0
  102. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/nx/nxTv3sKVUQZADJyM3dPaVmUA78MIsMLD_K279yN_GsI.cache +0 -0
  103. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/oz/ozRNsKle-0dkVv9TVQv2L4j0KHKVorNn-Y1ZoqeH23k.cache +0 -0
  104. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/p0/p0UgQyUa03wLjKCdKoh6l88KkFZm51Y6l2ErCpLpq6I.cache +1 -0
  105. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/p0/p0jMhMrkXWEXKdz0A_xO8foeJcDMfZU725lMT6cB9vk.cache +0 -0
  106. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/pc/pcLEltO95ofx-rKi148bXemS3vuiolGFQrQTEEaufBg.cache +1 -0
  107. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/pz/pzM3RUUwtXKhQ3imcaa9doASJAQJ3zXWHSk-tMaPmTE.cache +0 -0
  108. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/qO/qOCD4lYmSNrCmsS2Dlso08gYE3XqDgH6jfj8qv53VZE.cache +0 -0
  109. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/qg/qgo_TK76kN_M7OIblszKynmFxms-BnGAEcMuCFCcUmk.cache +1 -0
  110. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/rh/RhnOcAIH9GnZzgm48mq6kDm02o5RD0ruwS7Vc22Z0kA.cache +0 -0
  111. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/rh/rhiHxaMtmmZZYiO583Or4k7BPLAmMzeqyLc0gmJoKLg.cache +0 -0
  112. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/rx/rxcwzzK5tXb6VXzTjzMxfy6a4CdCOrU4mpq6zsOSCXE.cache +0 -0
  113. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/sX/sX4_nDcAYBCSCoSVewGQxOL5FI9vJgNVUSWDFwA0tUQ.cache +0 -0
  114. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/tc/tc_cLeZ4aQAI-SY7F67fDqd3rcESqbLaDrjsh6aE6FU.cache +1 -0
  115. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/to/tofj2C9SbKyYUj_dML3zHTK91A1mHAqikxNxok-XGGU.cache +0 -0
  116. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/uU/uUlJF0msNAdT4ST6rqRUkAdlH9vL4_Q3uAmcPmr_7Xw.cache +0 -0
  117. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/uU/uuTD2W9Def3Rk5kCW8BxVAcw6OvGZXvyHOy72YZCow0.cache +0 -0
  118. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/v0/v06KWsxyryY_cefXxIgvJij95aGaUkbxq3A885_7y5o.cache +1 -0
  119. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/vL/vLX0REBBtf63M9wzTi_c5JGvFp6Hw2TfvB8QNTvXF1o.cache +0 -0
  120. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/w9/w9K9vo0RempLOAQVeC3k12n9QJ1o7uyzzByc4y6PMmQ.cache +0 -0
  121. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/wX/wXNkAN8ZgMZVOPKuGDGGtarO_P1jzW9WrhvM9WdMtTM.cache +1 -0
  122. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/xF/xFziKPVCIY03L0QMyGb_Qwosu5RqxS2bgjsJa7lXZ_Q.cache +1 -0
  123. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/xH/xHYVu8nN-cIJEamW8IVhmY-VieizkWObrlah08OoMyA.cache +1 -0
  124. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/xQ/xQdSRH9yEopgH30aAN2vKW4HkDMMAt4XVJF-EKUMOhk.cache +2 -0
  125. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/xX/xXItV0-SqLEWMVEQR95OPM6uasu-sSI008PLfVivz8g.cache +0 -0
  126. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/xa/xaZG1JF1braF1MlRAgPC19dVKkA9Xdlx7YQb0JOOoF0.cache +1 -0
  127. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/z9/z9O51M9rznozjEDoJhswOkaolmfanQKZyCIXuM8jDqs.cache +3 -0
  128. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/zK/zKriUMIyjtR_QgfrDDjxeTzXauxjjWEFjfQwqLHULSE.cache +0 -0
  129. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/z_/z_i_-cAgESR9YdjR1qCZHQyu2qGIM0Ypxyk6hR6EYb4.cache +0 -0
  130. data/spec/dummy/tmp/export/28/exportable_data/10/index.html +14 -0
  131. data/spec/dummy/tmp/export/28/exportable_data/2/index.html +14 -0
  132. data/spec/dummy/tmp/export/28/exportable_data/3/index.html +14 -0
  133. data/spec/dummy/tmp/export/28/exportable_data/4/index.html +14 -0
  134. data/spec/dummy/tmp/export/28/exportable_data/5/index.html +14 -0
  135. data/spec/dummy/tmp/export/28/exportable_data/6/index.html +14 -0
  136. data/spec/dummy/tmp/export/28/exportable_data/7/index.html +14 -0
  137. data/spec/dummy/tmp/export/28/exportable_data/8/index.html +14 -0
  138. data/spec/dummy/tmp/export/28/exportable_data/9/index.html +14 -0
  139. data/spec/dummy/tmp/export/28/exportable_data/index.html +14 -0
  140. data/spec/dummy/tmp/export/28/index.html +16 -0
  141. data/spec/dummy/tmp/export/28-out.zip +0 -0
  142. data/spec/dummy/tmp/portability/1/build.zip +0 -0
  143. data/spec/dummy/tmp/portability/14/build.zip +0 -0
  144. data/spec/dummy/tmp/portability/15/build.zip +0 -0
  145. data/spec/dummy/tmp/portability/16/build.zip +0 -0
  146. data/spec/dummy/tmp/portability/17/build.zip +0 -0
  147. data/spec/dummy/tmp/portability/18/build.zip +0 -0
  148. data/spec/dummy/tmp/portability/2/build.zip +0 -0
  149. data/spec/dummy/tmp/portability/20/build.zip +0 -0
  150. data/spec/dummy/tmp/restart.txt +0 -0
  151. data/spec/models/policy_manager/another_user_spec.rb +134 -0
  152. data/spec/models/policy_manager/exporter_spec.rb +1 -0
  153. data/spec/models/policy_manager/portability_request_spec.rb +4 -1
  154. data/spec/models/policy_manager/user_spec.rb +13 -2
  155. metadata +300 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 81060ded3e832230b6f4536bdfc1eacf0df6bfc2f4e812ed0efde3f0c926c91b
4
- data.tar.gz: d42e46f8f425c30855ea979d1e8add10ef65b0415b836da61411d563c1df7383
3
+ metadata.gz: 386298d1731a0a6830f1445e562f7e4dd0bca49ee37b0eed4fb1e35b9e1b8ca8
4
+ data.tar.gz: 5f31692024cae1c58a1403679fd7690c50bf3c07776c3d912f0873cb264135d8
5
5
  SHA512:
6
- metadata.gz: 8341015bf4175df39f8ef6e5a82f48c6ae6f0c0478cf78ef0132302d7c1b4f4fe06e638cd85c6f97e3804cadf7cc3870efde6ddfe9c008c58d11a2a5b437dbaa
7
- data.tar.gz: 1f0af3c64fd15593aa1627674e19a4c46501f886dd4f0afd9ce530e702e5f1415cf0d35a85766b43cab07dac123ea08a85bb38853d8bfffdf0e7f87bd6d14daf
6
+ metadata.gz: 52c20ac58d490cda8066dde9adbd91a8630216a9aae6ac5110dedbae379882d934e56d24b4e360d77d08c25660cb38e26cebb03926aa37e595ca6682d7a0139a
7
+ data.tar.gz: 163475f3ad0de7c4e1ea477b59ab51796e1903e918facc04aa3c283b4faa1452e5cadc4dfac0ac50f4e03ef33ba6096f211befeae10d85c77fa54c3920a46395
@@ -0,0 +1,42 @@
1
+ module PolicyManager::Concerns::UserTerms
2
+
3
+ extend ActiveSupport::Concern
4
+
5
+ def accept_term(term)
6
+ if current_user
7
+ user_term = current_user.handle_policy_for(term)
8
+ return if user_term.accepted?
9
+ if user_term.accept!
10
+ term.rule.on_accept.call(self) if term.rule.on_accept.is_a?(Proc)
11
+ end
12
+ end
13
+
14
+ cookies["policy_rule_#{term.rule.name}"] = {
15
+ :value => "accepted",
16
+ :expires => 1.year.from_now
17
+ }
18
+
19
+ user_term
20
+ end
21
+
22
+ def reject_term(term)
23
+ if current_user
24
+ user_term = current_user.handle_policy_for(term)
25
+ return if user_term.rejected?
26
+ if user_term.reject!
27
+ term.rule.on_reject.call(self) if term.rule.on_reject.is_a?(Proc)
28
+ end
29
+ end
30
+
31
+ cookies.delete("policy_rule_#{term.rule.name}")
32
+
33
+ user_term
34
+ end
35
+
36
+ # Use callbacks to share common setup or constraints between actions.
37
+ def policy_term_on(name)
38
+ category = PolicyManager::Config.rules.find{|o| o.name == name}
39
+ category.terms.last
40
+ end
41
+
42
+ end
@@ -1,8 +1,11 @@
1
1
  require_dependency "policy_manager/application_controller"
2
+ require "policy_manager/concerns/user_terms"
2
3
 
3
4
  module PolicyManager
4
5
  class UserTermsController < ApplicationController
5
6
 
7
+ include PolicyManager::Concerns::UserTerms
8
+
6
9
  skip_before_action :user_authenticated?, only: [:show, :accept, :reject, :blocking_terms]
7
10
  before_action :set_user_term, only: [:accept, :reject, :show, :edit, :update, :destroy]
8
11
 
@@ -44,8 +47,7 @@ module PolicyManager
44
47
  end
45
48
 
46
49
  def accept
47
-
48
- handle_term_accept
50
+ @user_term = accept_term(@term)
49
51
 
50
52
  respond_to do |format|
51
53
  format.html{
@@ -65,7 +67,7 @@ module PolicyManager
65
67
  end
66
68
 
67
69
  def reject
68
- handle_term_reject
70
+ @user_term = reject_term(@term)
69
71
 
70
72
  respond_to do |format|
71
73
  format.html{
@@ -88,70 +90,10 @@ module PolicyManager
88
90
  end
89
91
  end
90
92
 
91
- =begin
92
- # GET /user_terms/new
93
- def new
94
- @user_term = UserTerm.new
95
- end
96
-
97
- # POST /user_terms
98
- def create
99
- @user_term = UserTerm.new(user_term_params)
100
-
101
- if @user_term.save
102
- redirect_to @user_term, notice: 'User term was successfully created.'
103
- else
104
- render :new
105
- end
106
- end
107
-
108
- # PATCH/PUT /user_terms/1
109
- def update
110
- if @user_term.update(user_term_params)
111
- redirect_to @user_term, notice: 'User term was successfully updated.'
112
- else
113
- render :edit
114
- end
115
- end
116
-
117
- # DELETE /user_terms/1
118
- def destroy
119
- @user_term.destroy
120
- redirect_to user_terms_url, notice: 'User term was successfully destroyed.'
121
- end
122
- =end
123
-
124
93
  private
125
94
 
126
- def handle_term_accept
127
- if current_user
128
- @user_term = current_user.handle_policy_for(@term)
129
- if @user_term.accept!
130
- @term.rule.on_accept.call(self) if @term.rule.on_accept.is_a?(Proc)
131
- end
132
- end
133
-
134
- cookies["policy_rule_#{@term.rule.name}"] = {
135
- :value => "accepted",
136
- :expires => 1.year.from_now
137
- }
138
- end
139
-
140
- def handle_term_reject
141
- if current_user
142
- @user_term = current_user.handle_policy_for(@term)
143
- if @user_term.reject!
144
- @term.rule.on_reject.call(self) if @term.rule.on_reject.is_a?(Proc)
145
- end
146
- end
147
-
148
- cookies.delete("policy_rule_#{@term.rule.name}")
149
- end
150
-
151
- # Use callbacks to share common setup or constraints between actions.
152
95
  def set_user_term
153
- @category = PolicyManager::Config.rules.find{|o| o.name == params[:id]}
154
- @term = @category.terms.last
96
+ @term = policy_term_on(params[:id])
155
97
  end
156
98
 
157
99
  # Only allow a trusted parameter "white list" through.
@@ -3,9 +3,9 @@ module PolicyManager::Concerns::UserBehavior
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
- has_many :user_terms, class_name: "PolicyManager::UserTerm", autosave: true
7
- has_many :terms, through: :user_terms, class_name: "PolicyManager::Term"
8
- has_many :portability_requests, class_name: "PolicyManager::PortabilityRequest"
6
+ has_many :user_terms, class_name: "PolicyManager::UserTerm", autosave: true, foreign_key: :user_id, inverse_of: :user
7
+ has_many :terms, through: :user_terms, class_name: "PolicyManager::Term", foreign_key: :user_id, inverse_of: :user
8
+ has_many :portability_requests, class_name: "PolicyManager::PortabilityRequest", foreign_key: :user_id, inverse_of: :user
9
9
 
10
10
  # adds policies
11
11
  PolicyManager::Config.rules.each do |rule|
@@ -87,14 +87,14 @@ module PolicyManager::Concerns::UserBehavior
87
87
  def confirm_all_policies!
88
88
  pending_policies.each do |c|
89
89
  term = c.terms.last
90
- current_user.handle_policy_for(term).accept!
90
+ self.handle_policy_for(term).accept!
91
91
  end
92
92
  end
93
93
 
94
94
  def reject_all_policies!
95
95
  pending_policies.each do |c|
96
96
  term = c.terms.last
97
- current_user.handle_policy_for(term).reject!
97
+ self.handle_policy_for(term).reject!
98
98
  end
99
99
  end
100
100
 
@@ -5,7 +5,7 @@ module PolicyManager
5
5
  class PortabilityRequest < ApplicationRecord
6
6
  include Paperclip::Glue
7
7
 
8
- belongs_to :user, class_name: Config.user_resource.to_s
8
+ belongs_to :user, class_name: Config.user_resource.to_s, foreign_key: :user_id
9
9
 
10
10
  has_attached_file :attachment,
11
11
  path: Config.exporter.try(:attachment_path) || Rails.root.join("tmp/portability/:id/build.zip").to_s,
@@ -4,7 +4,7 @@ module PolicyManager
4
4
  class UserTerm < ApplicationRecord
5
5
  include AASM
6
6
 
7
- belongs_to :user, class_name: Config.user_resource.to_s
7
+ belongs_to :user, class_name: Config.user_resource.to_s, foreign_key: :user_id
8
8
  belongs_to :term
9
9
 
10
10
  validates_uniqueness_of :term_id, :scope => :user_id
@@ -22,7 +22,7 @@ module PolicyManager
22
22
 
23
23
  # sets this defaults after configuration
24
24
  @@user_resource ||= 'User'
25
- @@admin_user_resource ||= 'User'
25
+ @@admin_user_resource ||= @@user_resource
26
26
 
27
27
  self
28
28
  end
@@ -1,3 +1,3 @@
1
1
  module PolicyManager
2
- VERSION = '0.3.4'
2
+ VERSION = '0.4.0'
3
3
  end
@@ -0,0 +1,26 @@
1
+ class AnotherUser < ApplicationRecord
2
+ include PolicyManager::Concerns::UserBehavior
3
+
4
+ def enabled_for_validation
5
+ true
6
+ end
7
+
8
+ def foo_data
9
+ 30.times.map do |i|
10
+ OpenStruct.new(
11
+ :id => i,
12
+ :country => "Australia",
13
+ :population => 20_000_000,
14
+ image: "http://lorempixel.com/400/200/sports/"
15
+ )
16
+ end
17
+ end
18
+
19
+ def account_data
20
+ {
21
+ name: "me",
22
+ dob: 30.years.ago,
23
+ image: "https://images.pexels.com/photos/34950/pexels-photo.jpg?auto=compress&cs=tinysrgb&h=650&w=940 1x, https://images.pexels.com/photos/34950/pexels-photo.jpg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940 2x"
24
+ }
25
+ end
26
+ end
@@ -12,7 +12,7 @@ default: &default
12
12
  test:
13
13
  adapter: mysql2
14
14
  database: gdpr_test
15
- host: "localhost"
15
+ host: <%= ENV.fetch("MYSQL_HOST") { "localhost"} %>
16
16
  username: root
17
17
  password:
18
18
  reconnect: true
Binary file
@@ -0,0 +1,9 @@
1
+ class CreateAnotherUsers < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :another_users do |t|
4
+ t.string :email
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -10,44 +10,15 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 20180410171354) do
13
+ ActiveRecord::Schema.define(version: 2019_02_21_193827) do
14
14
 
15
- create_table "policy_manager_portability_requests", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
16
- t.integer "user_id"
17
- t.string "state"
18
- t.string "attachment"
19
- t.string "attachment_file_name"
20
- t.string "attachment_file_size"
21
- t.datetime "attachment_content_type"
22
- t.string "attachment_file_content_type"
23
- t.datetime "expire_at"
24
- t.datetime "created_at", null: false
25
- t.datetime "updated_at", null: false
26
- t.index ["user_id"], name: "index_policy_manager_portability_requests_on_user_id"
27
- end
28
-
29
- create_table "policy_manager_terms", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
30
- t.text "description"
31
- t.string "rule"
32
- t.string "state"
33
- t.datetime "accepted_at"
34
- t.datetime "rejected_at"
35
- t.datetime "created_at", null: false
36
- t.datetime "updated_at", null: false
37
- end
38
-
39
- create_table "policy_manager_user_terms", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
40
- t.integer "user_id"
41
- t.integer "term_id"
42
- t.string "state"
15
+ create_table "another_users", force: :cascade do |t|
16
+ t.string "email"
43
17
  t.datetime "created_at", null: false
44
18
  t.datetime "updated_at", null: false
45
- t.index ["state"], name: "index_policy_manager_user_terms_on_state"
46
- t.index ["term_id"], name: "index_policy_manager_user_terms_on_term_id"
47
- t.index ["user_id"], name: "index_policy_manager_user_terms_on_user_id"
48
19
  end
49
20
 
50
- create_table "users", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
21
+ create_table "users", force: :cascade do |t|
51
22
  t.string "email"
52
23
  t.datetime "created_at", null: false
53
24
  t.datetime "updated_at", null: false