rails_admin 0.4.9 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rails_admin might be problematic. Click here for more details.

Files changed (281) hide show
  1. data.tar.gz.sig +0 -0
  2. data/Gemfile +10 -9
  3. data/README.md +9 -0
  4. data/app/assets/javascripts/rails_admin/ra.filtering-select.js +3 -3
  5. data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.coffee +1 -1
  6. data/app/assets/javascripts/rails_admin/ra.remote-form.js +1 -1
  7. data/app/assets/javascripts/rails_admin/ra.widgets.coffee +28 -26
  8. data/app/helpers/rails_admin/application_helper.rb +2 -2
  9. data/app/views/rails_admin/main/_form_ck_editor.html.haml +10 -0
  10. data/app/views/rails_admin/main/_form_code_mirror.html.haml +9 -0
  11. data/app/views/rails_admin/main/_form_text.html.haml +1 -31
  12. data/app/views/rails_admin/main/_form_wysihtml5.html.haml +8 -0
  13. data/lib/generators/rails_admin/install_generator.rb +40 -31
  14. data/lib/generators/rails_admin/templates/initializer.erb +2 -2
  15. data/lib/rails_admin/abstract_model.rb +1 -1
  16. data/lib/rails_admin/adapters/active_record.rb +21 -17
  17. data/lib/rails_admin/adapters/active_record/abstract_object.rb +1 -1
  18. data/lib/rails_admin/adapters/mongoid.rb +1 -0
  19. data/lib/rails_admin/config.rb +2 -2
  20. data/lib/rails_admin/config/configurable.rb +13 -5
  21. data/lib/rails_admin/config/fields/base.rb +1 -25
  22. data/lib/rails_admin/config/fields/factories/enum.rb +8 -1
  23. data/lib/rails_admin/config/fields/types/all.rb +4 -1
  24. data/lib/rails_admin/config/fields/types/ck_editor.rb +45 -0
  25. data/lib/rails_admin/config/fields/types/code_mirror.rb +55 -0
  26. data/lib/rails_admin/config/fields/types/serialized.rb +1 -1
  27. data/lib/rails_admin/config/fields/types/text.rb +12 -66
  28. data/lib/rails_admin/config/fields/types/wysihtml5.rb +44 -0
  29. data/lib/rails_admin/config/model.rb +1 -1
  30. data/lib/rails_admin/extensions/history/history.rb +4 -2
  31. data/lib/rails_admin/version.rb +2 -2
  32. data/spec/controllers/rails_admin/main_controller_spec.rb +21 -0
  33. data/spec/dummy_app/Gemfile +11 -10
  34. data/spec/dummy_app/app/active_record/another_field_test.rb +0 -1
  35. data/spec/dummy_app/app/active_record/ball.rb +0 -2
  36. data/spec/dummy_app/app/active_record/category.rb +0 -2
  37. data/spec/dummy_app/app/active_record/cms/basic_page.rb +0 -2
  38. data/spec/dummy_app/app/active_record/comment.rb +0 -2
  39. data/spec/dummy_app/app/active_record/comment/confirmed.rb +1 -1
  40. data/spec/dummy_app/app/active_record/division.rb +0 -2
  41. data/spec/dummy_app/app/active_record/draft.rb +0 -2
  42. data/spec/dummy_app/app/active_record/fan.rb +0 -2
  43. data/spec/dummy_app/app/active_record/field_test.rb +0 -5
  44. data/spec/dummy_app/app/active_record/image.rb +0 -2
  45. data/spec/dummy_app/app/active_record/league.rb +1 -3
  46. data/spec/dummy_app/app/active_record/nested_field_test.rb +0 -2
  47. data/spec/dummy_app/app/active_record/player.rb +0 -3
  48. data/spec/dummy_app/app/active_record/team.rb +1 -4
  49. data/spec/dummy_app/app/active_record/user.rb +0 -4
  50. data/spec/dummy_app/app/mongoid/another_field_test.rb +0 -1
  51. data/spec/dummy_app/app/mongoid/ball.rb +0 -2
  52. data/spec/dummy_app/app/mongoid/category.rb +0 -2
  53. data/spec/dummy_app/app/mongoid/cms/basic_page.rb +0 -2
  54. data/spec/dummy_app/app/mongoid/comment.rb +0 -2
  55. data/spec/dummy_app/app/mongoid/division.rb +0 -2
  56. data/spec/dummy_app/app/mongoid/draft.rb +0 -2
  57. data/spec/dummy_app/app/mongoid/fan.rb +0 -2
  58. data/spec/dummy_app/app/mongoid/field_test.rb +1 -5
  59. data/spec/dummy_app/app/mongoid/image.rb +0 -2
  60. data/spec/dummy_app/app/mongoid/league.rb +0 -2
  61. data/spec/dummy_app/app/mongoid/nested_field_test.rb +0 -2
  62. data/spec/dummy_app/app/mongoid/player.rb +1 -3
  63. data/spec/dummy_app/app/mongoid/team.rb +0 -2
  64. data/spec/dummy_app/app/mongoid/user.rb +1 -2
  65. data/spec/dummy_app/config/application.rb +0 -7
  66. data/spec/dummy_app/config/environments/development.rb +1 -7
  67. data/spec/dummy_app/config/environments/test.rb +2 -4
  68. data/spec/dummy_app/config/initializers/secret_token.rb +1 -0
  69. data/spec/dummy_app/config/routes.rb +2 -2
  70. data/spec/dummy_app/db/test.sqlite3 +0 -0
  71. data/spec/dummy_app/db/test.sqlite3-journal +0 -0
  72. data/spec/dummy_app/log/test.log +1423 -0
  73. data/spec/dummy_app/tmp/cache/assets/test/sass/0759f2828afb668a39de3ede4887b369780cdb28/jquery-ui-1.8.7.custom.scssc +0 -0
  74. data/spec/dummy_app/tmp/cache/assets/test/sass/1de49575831c79805eaa5ca759c4aae181c38254/mixins.scssc +0 -0
  75. data/spec/dummy_app/tmp/cache/assets/test/sass/1de49575831c79805eaa5ca759c4aae181c38254/theming.scssc +0 -0
  76. data/spec/dummy_app/tmp/cache/assets/test/sass/1de49575831c79805eaa5ca759c4aae181c38254/variables.scssc +0 -0
  77. data/spec/dummy_app/tmp/cache/assets/test/sass/50e4466efc3255401f37f709f5f338668408ef71/mixins.scssc +0 -0
  78. data/spec/dummy_app/tmp/cache/assets/test/sass/50e4466efc3255401f37f709f5f338668408ef71/theming.scssc +0 -0
  79. data/spec/dummy_app/tmp/cache/assets/test/sass/50e4466efc3255401f37f709f5f338668408ef71/variables.scssc +0 -0
  80. data/spec/dummy_app/tmp/cache/assets/test/sass/60ddb7b14935cbd11f83ec188b4bb1d618ec996f/jquery.colorpicker.scssc +0 -0
  81. data/spec/dummy_app/tmp/cache/assets/test/sass/60ddb7b14935cbd11f83ec188b4bb1d618ec996f/jquery.ui.timepicker.scssc +0 -0
  82. data/spec/dummy_app/tmp/cache/assets/test/sass/60ddb7b14935cbd11f83ec188b4bb1d618ec996f/ra.calendar-additions.scssc +0 -0
  83. data/spec/dummy_app/tmp/cache/assets/test/sass/60ddb7b14935cbd11f83ec188b4bb1d618ec996f/ra.filtering-multiselect.scssc +0 -0
  84. data/spec/dummy_app/tmp/cache/assets/test/sass/60ddb7b14935cbd11f83ec188b4bb1d618ec996f/ra.widgets.scssc +0 -0
  85. data/spec/dummy_app/tmp/cache/assets/test/sass/60ddb7b14935cbd11f83ec188b4bb1d618ec996f/rails_admin.scss.erbc +0 -0
  86. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_accordion.scssc +0 -0
  87. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_alerts.scssc +0 -0
  88. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_breadcrumbs.scssc +0 -0
  89. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_button-groups.scssc +0 -0
  90. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_buttons.scssc +0 -0
  91. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_carousel.scssc +0 -0
  92. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_close.scssc +0 -0
  93. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_component-animations.scssc +0 -0
  94. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_dropdowns.scssc +0 -0
  95. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_forms.scssc +0 -0
  96. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_grid.scssc +0 -0
  97. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_hero-unit.scssc +0 -0
  98. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_labels-badges.scssc +0 -0
  99. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_layouts.scssc +0 -0
  100. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_mixins.scssc +0 -0
  101. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_modals.scssc +0 -0
  102. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_navbar.scssc +0 -0
  103. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_navs.scssc +0 -0
  104. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_pager.scssc +0 -0
  105. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_pagination.scssc +0 -0
  106. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_popovers.scssc +0 -0
  107. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_progress-bars.scssc +0 -0
  108. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_reset.scssc +0 -0
  109. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_scaffolding.scssc +0 -0
  110. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_tables.scssc +0 -0
  111. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_thumbnails.scssc +0 -0
  112. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_tooltip.scssc +0 -0
  113. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_type.scssc +0 -0
  114. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_utilities.scssc +0 -0
  115. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_variables.scssc +0 -0
  116. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_wells.scssc +0 -0
  117. data/spec/dummy_app/tmp/cache/assets/test/sass/7e38bdfe3aa21a76da53ed64003686502baf8110/font-awesome.css.erbc +0 -0
  118. data/spec/dummy_app/tmp/cache/assets/test/sass/e307626ae1f1da10c3b3073e0db008ce0a7bb251/mixins.scssc +0 -0
  119. data/spec/dummy_app/tmp/cache/assets/test/sass/e307626ae1f1da10c3b3073e0db008ce0a7bb251/theming.scssc +0 -0
  120. data/spec/dummy_app/tmp/cache/assets/test/sass/e307626ae1f1da10c3b3073e0db008ce0a7bb251/variables.scssc +0 -0
  121. data/spec/dummy_app/tmp/cache/assets/test/sprockets/039a5bf66d220fc450725c31951c0003 +0 -0
  122. data/spec/dummy_app/tmp/cache/assets/test/sprockets/04fc3904edb99236187355cbb911f89e +0 -0
  123. data/spec/dummy_app/tmp/cache/assets/test/sprockets/0602c18d49d9162a4115f24689044530 +0 -0
  124. data/spec/dummy_app/tmp/cache/assets/test/sprockets/07a77b4186e7385aa93ee9817d30976d +0 -0
  125. data/spec/dummy_app/tmp/cache/assets/test/sprockets/09b197beb54130b951fd00df7b3e2ebb +0 -0
  126. data/spec/dummy_app/tmp/cache/assets/test/sprockets/0c53bdcb904e01bc3006dea06a984620 +0 -0
  127. data/spec/dummy_app/tmp/cache/assets/test/sprockets/0cf66ef0545ef4a25158b64a8a63acc0 +0 -0
  128. data/spec/dummy_app/tmp/cache/assets/test/sprockets/0dcf1b67fc7a00043acda5614e28621a +0 -0
  129. data/spec/dummy_app/tmp/cache/assets/test/sprockets/0ed5cf232eb4a060d90fa60242ec82eb +0 -0
  130. data/spec/dummy_app/tmp/cache/assets/test/sprockets/104cf49747acce2cd760bde221916757 +0 -0
  131. data/spec/dummy_app/tmp/cache/assets/test/sprockets/11336ccd98408f1d60bc4f137dd6d513 +0 -0
  132. data/spec/dummy_app/tmp/cache/assets/test/sprockets/129ab684736012c224b424a9202c4077 +0 -0
  133. data/spec/dummy_app/tmp/cache/assets/test/sprockets/13c5851787eee7ea1dbb6771daf38754 +0 -0
  134. data/spec/dummy_app/tmp/cache/assets/test/sprockets/148bf2b1fa2b1c501e534d8019e35550 +0 -0
  135. data/spec/dummy_app/tmp/cache/assets/test/sprockets/17805e3468eb563f81855f6ac93ac7de +0 -0
  136. data/spec/dummy_app/tmp/cache/assets/test/sprockets/196f8e4aff622708f7a2060b98fa730a +0 -0
  137. data/spec/dummy_app/tmp/cache/assets/test/sprockets/1a1d73dd5f0ac320b3a8952b0e6669f5 +0 -0
  138. data/spec/dummy_app/tmp/cache/assets/test/sprockets/1a5c2589d7a73ca326745770ec8c3a68 +0 -0
  139. data/spec/dummy_app/tmp/cache/assets/test/sprockets/1b1d3f4fa8e1243fb66271b20233d01b +0 -0
  140. data/spec/dummy_app/tmp/cache/assets/test/sprockets/1ca1a15643004e8daee77e762149bfe6 +0 -0
  141. data/spec/dummy_app/tmp/cache/assets/test/sprockets/1cb0bbe35ef01a226fef698f0a9277d2 +0 -0
  142. data/spec/dummy_app/tmp/cache/assets/test/sprockets/1d635e9b0475899eec5bce058b6d48b4 +0 -0
  143. data/spec/dummy_app/tmp/cache/assets/test/sprockets/1e097efcd1115a58473612106f20aad2 +0 -0
  144. data/spec/dummy_app/tmp/cache/assets/test/sprockets/2047e1449cbcbd8331c15e05c33f006a +0 -0
  145. data/spec/dummy_app/tmp/cache/assets/test/sprockets/2740e776eb74b1103220f4a3bf76e55d +0 -0
  146. data/spec/dummy_app/tmp/cache/assets/test/sprockets/281a64929dab11d3635bdd9ff39fe31c +0 -0
  147. data/spec/dummy_app/tmp/cache/assets/test/sprockets/28549a2080576826cd4de9ce7ed8d69f +0 -0
  148. data/spec/dummy_app/tmp/cache/assets/test/sprockets/2e1c59996da5739b76e5ed290e16e4b8 +0 -0
  149. data/spec/dummy_app/tmp/cache/assets/test/sprockets/308e53bfc20ae7fe1c148e8cd4795184 +0 -0
  150. data/spec/dummy_app/tmp/cache/assets/test/sprockets/30d3cccc8e819bfc42faebbae2132106 +0 -0
  151. data/spec/dummy_app/tmp/cache/assets/test/sprockets/349b83b5f7fc156a7865362b50c8a747 +0 -0
  152. data/spec/dummy_app/tmp/cache/assets/test/sprockets/352b668d5a833880cd46e68e87b61f83 +0 -0
  153. data/spec/dummy_app/tmp/cache/assets/test/sprockets/3a44eeaaf1973955ec1385900f16e9b0 +0 -0
  154. data/spec/dummy_app/tmp/cache/assets/test/sprockets/3b9145cad8e6cc05febf5b7ebfdc09b5 +0 -0
  155. data/spec/dummy_app/tmp/cache/assets/test/sprockets/3ba0f5b2e3e94b6513f5136fa20e5a24 +0 -0
  156. data/spec/dummy_app/tmp/cache/assets/test/sprockets/3bb982191028c492bec814ca36dda349 +0 -0
  157. data/spec/dummy_app/tmp/cache/assets/test/sprockets/3e529508d6168a92db8f1706328dbd6b +0 -0
  158. data/spec/dummy_app/tmp/cache/assets/test/sprockets/3fea6c96d559fd56c796222c89bf4a55 +0 -0
  159. data/spec/dummy_app/tmp/cache/assets/test/sprockets/410492703e63dffa68a29af838226cc6 +0 -0
  160. data/spec/dummy_app/tmp/cache/assets/test/sprockets/433362a2fd8b9b7a80331d20cdfd84b6 +0 -0
  161. data/spec/dummy_app/tmp/cache/assets/test/sprockets/445343e680a88785242a2aa99d907216 +0 -0
  162. data/spec/dummy_app/tmp/cache/assets/test/sprockets/4499a6f31ad672fb69537267becff285 +0 -0
  163. data/spec/dummy_app/tmp/cache/assets/test/sprockets/455dc61be5289cb0a50fc650c4a27b01 +0 -0
  164. data/spec/dummy_app/tmp/cache/assets/test/sprockets/4563ab77d6c769264c70b904c4ca2b37 +0 -0
  165. data/spec/dummy_app/tmp/cache/assets/test/sprockets/4c501e79458ca87b9b7964a3656cad68 +0 -0
  166. data/spec/dummy_app/tmp/cache/assets/test/sprockets/4f49294c06a799e1c063a1ccf100860c +0 -0
  167. data/spec/dummy_app/tmp/cache/assets/test/sprockets/4fd99da81590fb27074904dd2d4b0afe +0 -0
  168. data/spec/dummy_app/tmp/cache/assets/test/sprockets/54a5de7c79d8407342c31af3d5eb31f6 +0 -0
  169. data/spec/dummy_app/tmp/cache/assets/test/sprockets/5507d3ba3736f304240090662413733a +0 -0
  170. data/spec/dummy_app/tmp/cache/assets/test/sprockets/585bed8595e5e9d8e5e1a680ac20f005 +0 -0
  171. data/spec/dummy_app/tmp/cache/assets/test/sprockets/5c0be9a39a450f2b191275d281ff50d8 +0 -0
  172. data/spec/dummy_app/tmp/cache/assets/test/sprockets/5eab397d2a4b6ca7b0084107e4acc0d9 +0 -0
  173. data/spec/dummy_app/tmp/cache/assets/test/sprockets/5eae694e8713be9376531ee73716b107 +0 -0
  174. data/spec/dummy_app/tmp/cache/assets/test/sprockets/6012dbf768041ff3d9566cd00e6ad0e6 +0 -0
  175. data/spec/dummy_app/tmp/cache/assets/test/sprockets/61077cb42651197ce0d00d267f8cb157 +0 -0
  176. data/spec/dummy_app/tmp/cache/assets/test/sprockets/627a45561b3d1ecbd1a1f4850208503a +0 -0
  177. data/spec/dummy_app/tmp/cache/assets/test/sprockets/642ea63365a0f33fb982cde355dbd952 +0 -0
  178. data/spec/dummy_app/tmp/cache/assets/test/sprockets/67c296751ce247c30402dd43b035c05b +0 -0
  179. data/spec/dummy_app/tmp/cache/assets/test/sprockets/689332efdfbf2cfa06d02d26a47d4332 +0 -0
  180. data/spec/dummy_app/tmp/cache/assets/test/sprockets/694afe79cc6e42a3e5436d282997ea79 +0 -0
  181. data/spec/dummy_app/tmp/cache/assets/test/sprockets/6c5729b427f229cad24067bfec82441d +0 -0
  182. data/spec/dummy_app/tmp/cache/assets/test/sprockets/6f0a4a833a1ce47d77ebbd71ae021a4d +0 -0
  183. data/spec/dummy_app/tmp/cache/assets/test/sprockets/702016a19f9bf693eec6930878077e4e +0 -0
  184. data/spec/dummy_app/tmp/cache/assets/test/sprockets/724ce3ff0aeb1174d3a8fddfe1335a79 +0 -0
  185. data/spec/dummy_app/tmp/cache/assets/test/sprockets/726abc48daa7878021ee1c34360918af +0 -0
  186. data/spec/dummy_app/tmp/cache/assets/test/sprockets/749c6e08a7826fd22d279405af87aaf1 +0 -0
  187. data/spec/dummy_app/tmp/cache/assets/test/sprockets/77ad5664cd45382abab39f19d032133d +0 -0
  188. data/spec/dummy_app/tmp/cache/assets/test/sprockets/785692dac9a319d2706bd96d7fb5999c +0 -0
  189. data/spec/dummy_app/tmp/cache/assets/test/sprockets/7cfceeccc9c61c03ad54298ce2472f45 +0 -0
  190. data/spec/dummy_app/tmp/cache/assets/test/sprockets/7e73c94fd43e4f8b82acfa085d8d5476 +0 -0
  191. data/spec/dummy_app/tmp/cache/assets/test/sprockets/801e4f782d10f5498b68113e6b2ac139 +0 -0
  192. data/spec/dummy_app/tmp/cache/assets/test/sprockets/822dbfd89b2b1243844e7c3a0ba001a7 +0 -0
  193. data/spec/dummy_app/tmp/cache/assets/test/sprockets/842ea8c5f8b0fdb4ef7472b189a76174 +0 -0
  194. data/spec/dummy_app/tmp/cache/assets/test/sprockets/84a6a7978131f4f8c46fe9c480634aab +0 -0
  195. data/spec/dummy_app/tmp/cache/assets/test/sprockets/84cb05237234ff279ad6c78ef3e8e823 +0 -0
  196. data/spec/dummy_app/tmp/cache/assets/test/sprockets/84f51912f02a7a1ff255ae491b3cc711 +0 -0
  197. data/spec/dummy_app/tmp/cache/assets/test/sprockets/8605a56363a1d23fad98fbc6d9b3b047 +0 -0
  198. data/spec/dummy_app/tmp/cache/assets/test/sprockets/86120a9bdcdfa970f8dadae131a2e95e +0 -0
  199. data/spec/dummy_app/tmp/cache/assets/test/sprockets/88c829469780275b9c1714e2166e1ba4 +0 -0
  200. data/spec/dummy_app/tmp/cache/assets/test/sprockets/89ffe73975976a0200a923aa2e1e42fb +0 -0
  201. data/spec/dummy_app/tmp/cache/assets/test/sprockets/8b0a8bf59842e1d4aaa787eff38e207f +0 -0
  202. data/spec/dummy_app/tmp/cache/assets/test/sprockets/8b78cef60b108a16787f32ea26a792d0 +0 -0
  203. data/spec/dummy_app/tmp/cache/assets/test/sprockets/8ddbd7ab77689f8ebb25c59de8152b5e +0 -0
  204. data/spec/dummy_app/tmp/cache/assets/test/sprockets/8f9bc2d4514893616bed6d6bf75dded1 +0 -0
  205. data/spec/dummy_app/tmp/cache/assets/test/sprockets/91cb85d19bf8e4ebba27ccf6ea318d9f +0 -0
  206. data/spec/dummy_app/tmp/cache/assets/test/sprockets/922df3fedca77782061a6d4a6029e7f1 +0 -0
  207. data/spec/dummy_app/tmp/cache/assets/test/sprockets/9509bd192a75365a34a00b01e04b5ab4 +0 -0
  208. data/spec/dummy_app/tmp/cache/assets/test/sprockets/97cd44fc8e2b4f6acb0d912be738c90f +0 -0
  209. data/spec/dummy_app/tmp/cache/assets/test/sprockets/98a7dfb33d5879f166f1bf20c031e836 +0 -0
  210. data/spec/dummy_app/tmp/cache/assets/test/sprockets/98d49f7e1c1d73b97ac2937069e8f312 +0 -0
  211. data/spec/dummy_app/tmp/cache/assets/test/sprockets/99c1629b9f2827a9840fe8d230e2c5df +0 -0
  212. data/spec/dummy_app/tmp/cache/assets/test/sprockets/9a451dac641c38ce41d5c1b73fb8de2a +0 -0
  213. data/spec/dummy_app/tmp/cache/assets/test/sprockets/9ba5e11e725ed4a76f73bc3c43070fc9 +0 -0
  214. data/spec/dummy_app/tmp/cache/assets/test/sprockets/9c332bf94ad0e3614abadfaf3aaf60b2 +0 -0
  215. data/spec/dummy_app/tmp/cache/assets/test/sprockets/9cf969e4845d5a4d718d2e8bfd77101d +0 -0
  216. data/spec/dummy_app/tmp/cache/assets/test/sprockets/9f9d40e0ca625e92215807c7d36eeb45 +0 -0
  217. data/spec/dummy_app/tmp/cache/assets/test/sprockets/a0d2eb8c9feccca7df34d40b8614a939 +0 -0
  218. data/spec/dummy_app/tmp/cache/assets/test/sprockets/a1657b7bdf73ec95be9f0514ee2254a2 +0 -0
  219. data/spec/dummy_app/tmp/cache/assets/test/sprockets/a1c38b062b4789cba43cfce569d89a4e +0 -0
  220. data/spec/dummy_app/tmp/cache/assets/test/sprockets/a2346449005dbaa9093d8ba7ed2a5d47 +0 -0
  221. data/spec/dummy_app/tmp/cache/assets/test/sprockets/a86a829dee3d408be1e17d970ee388fa +0 -0
  222. data/spec/dummy_app/tmp/cache/assets/test/sprockets/ab554675ca375fa03f104b42bd948fe5 +0 -0
  223. data/spec/dummy_app/tmp/cache/assets/test/sprockets/aded07271baf96cd6d24924ad93ec73d +0 -0
  224. data/spec/dummy_app/tmp/cache/assets/test/sprockets/ae325bc4588e222725187e5daf205589 +0 -0
  225. data/spec/dummy_app/tmp/cache/assets/test/sprockets/af529b87b946c6e64306fcce7453083e +0 -0
  226. data/spec/dummy_app/tmp/cache/assets/test/sprockets/b4760047e80466e8355e67301426c1d1 +0 -0
  227. data/spec/dummy_app/tmp/cache/assets/test/sprockets/b845c9c605c0ac49de3fbbb504e230f7 +0 -0
  228. data/spec/dummy_app/tmp/cache/assets/test/sprockets/b85362aec4168f3dc8d2a98060ee48eb +0 -0
  229. data/spec/dummy_app/tmp/cache/assets/test/sprockets/bab7336757583f60e7daf1487188ed18 +0 -0
  230. data/spec/dummy_app/tmp/cache/assets/test/sprockets/bd0a6ea6e12c15771e7f2523a3aadc63 +0 -0
  231. data/spec/dummy_app/tmp/cache/assets/test/sprockets/be49600855e45c34cba5d2d6746e2358 +0 -0
  232. data/spec/dummy_app/tmp/cache/assets/test/sprockets/be9c7f67a4c4bccb12ebfde75deadf78 +0 -0
  233. data/spec/dummy_app/tmp/cache/assets/test/sprockets/bff19a6530ebd8793f533e767a24e36e +0 -0
  234. data/spec/dummy_app/tmp/cache/assets/test/sprockets/c3be8bc6957ae7e95fb42e95b69a28c4 +0 -0
  235. data/spec/dummy_app/tmp/cache/assets/test/sprockets/c5787e2ae92280dbccc527e55b11635e +0 -0
  236. data/spec/dummy_app/tmp/cache/assets/test/sprockets/c5d9cd7fa2cb7bfe369963b0196f7ff4 +0 -0
  237. data/spec/dummy_app/tmp/cache/assets/test/sprockets/cfbcfcb1da5d394fb109e81d39e78159 +0 -0
  238. data/spec/dummy_app/tmp/cache/assets/test/sprockets/d07f5793bd18b01f933ddca0fe37250e +0 -0
  239. data/spec/dummy_app/tmp/cache/assets/test/sprockets/d0a719959de8c62c5bd015cce560bc8a +0 -0
  240. data/spec/dummy_app/tmp/cache/assets/test/sprockets/d4c23978dcf23280699067752b4d380d +0 -0
  241. data/spec/dummy_app/tmp/cache/assets/test/sprockets/d4e3f96df2204b35a7e8350ecc41cdc7 +0 -0
  242. data/spec/dummy_app/tmp/cache/assets/test/sprockets/d5d70fe44f0d681894cd75826cdaea12 +0 -0
  243. data/spec/dummy_app/tmp/cache/assets/test/sprockets/d6a6297cee0fca1e5e0838f582d80ab2 +0 -0
  244. data/spec/dummy_app/tmp/cache/assets/test/sprockets/d9266b8e42d3f777dc223da809274b31 +0 -0
  245. data/spec/dummy_app/tmp/cache/assets/test/sprockets/db583f90e8ee3ef1d2f254872519e9c6 +0 -0
  246. data/spec/dummy_app/tmp/cache/assets/test/sprockets/e4cc8214b21af79b430cd379aafeb4ce +0 -0
  247. data/spec/dummy_app/tmp/cache/assets/test/sprockets/e4e7c80687aa50a6e2e4b7c79a145a0c +0 -0
  248. data/spec/dummy_app/tmp/cache/assets/test/sprockets/e53e14c5fb50eb16744db14274a7eda8 +0 -0
  249. data/spec/dummy_app/tmp/cache/assets/test/sprockets/e600b47ff99e3ad76cb108e6c312c5b5 +0 -0
  250. data/spec/dummy_app/tmp/cache/assets/test/sprockets/e8f7215dd1531e59847951a7383271c5 +0 -0
  251. data/spec/dummy_app/tmp/cache/assets/test/sprockets/eb6ed96d57beb3fd8059dc280a7c2cd7 +0 -0
  252. data/spec/dummy_app/tmp/cache/assets/test/sprockets/ed5e8a35a505b86b4bf715b78391a870 +0 -0
  253. data/spec/dummy_app/tmp/cache/assets/test/sprockets/ee5e4d214ffc908f50e0a637eed3b7b1 +0 -0
  254. data/spec/dummy_app/tmp/cache/assets/test/sprockets/ef0431217a4bac4852ecc9987fd2629e +0 -0
  255. data/spec/dummy_app/tmp/cache/assets/test/sprockets/f28c745f4469bda7feb0e7b30c6a49ae +0 -0
  256. data/spec/dummy_app/tmp/cache/assets/test/sprockets/f43162a23f1a30e5baf49f543f72487d +0 -0
  257. data/spec/dummy_app/tmp/cache/assets/test/sprockets/f62c80206996d477a114b40987636c55 +0 -0
  258. data/spec/dummy_app/tmp/cache/assets/test/sprockets/f72d29b2f2b71e9f9f690a806f572e21 +0 -0
  259. data/spec/dummy_app/tmp/cache/assets/test/sprockets/fa8aef4c90e0b7f97618ed51c78eb38a +0 -0
  260. data/spec/dummy_app/tmp/cache/assets/test/sprockets/fb7856209a606e83084889ae67f02673 +0 -0
  261. data/spec/dummy_app/tmp/cache/assets/test/sprockets/fb7a84e10813b0033c09263a0abf0fa3 +0 -0
  262. data/spec/dummy_app/tmp/cache/assets/test/sprockets/fb94af8a31614a8efe49c2714a8f894e +0 -0
  263. data/spec/dummy_app/tmp/cache/assets/test/sprockets/fea0b3135fde8d44c3aaf052a21d28f8 +0 -0
  264. data/spec/dummy_app/tmp/cache/assets/test/sprockets/ff4c93f7f26410e737809fc8772ddc5c +0 -0
  265. data/spec/integration/authorization/cancan_spec.rb +8 -16
  266. data/spec/integration/basic/export/rails_admin_basic_export_spec.rb +1 -1
  267. data/spec/integration/config/edit/rails_admin_config_edit_spec.rb +9 -34
  268. data/spec/integration/config/show/rails_admin_config_show_spec.rb +1 -1
  269. data/spec/integration/rails_admin_spec.rb +2 -2
  270. data/spec/rails_admin/abstract_model_spec.rb +1 -1
  271. data/spec/rails_admin/adapters/active_record/abstract_object_spec.rb +5 -5
  272. data/spec/rails_admin/adapters/active_record_spec.rb +11 -9
  273. data/spec/rails_admin/adapters/mongoid_spec.rb +1 -1
  274. data/spec/rails_admin/config/fields/base_spec.rb +1 -48
  275. data/spec/rails_admin/config/fields/types/{text_spec.rb → ck_editor_spec.rb} +6 -3
  276. metadata +418 -46
  277. metadata.gz.sig +3 -2
  278. data/spec/dummy_app/app/active_record/cms/unscoped_page.rb +0 -3
  279. data/spec/dummy_app/app/mongoid/cms/unscoped_page.rb +0 -5
  280. data/spec/dummy_app/config/initializers/strong_parameters.rb +0 -2
  281. data/spec/dummy_app/db/migrate/20111103174459_create_unscoped_pages.rb +0 -9
@@ -0,0 +1,44 @@
1
+ require 'rails_admin/config/fields/base'
2
+
3
+ module RailsAdmin
4
+ module Config
5
+ module Fields
6
+ module Types
7
+ class Wysihtml5 < RailsAdmin::Config::Fields::Types::Text
8
+ # Register field type for the type loader
9
+ RailsAdmin::Config::Fields::Types::register(self)
10
+
11
+ # If you want to have a different toolbar configuration for wysihtml5
12
+ # you can use a Ruby hash to configure these options:
13
+ # https://github.com/jhollingworth/bootstrap-wysihtml5/#advanced
14
+ register_instance_option :config_options do
15
+ nil
16
+ end
17
+
18
+ register_instance_option :css_location do
19
+ '/assets/bootstrap-wysihtml5.css'
20
+ end
21
+
22
+ register_instance_option :js_location do
23
+ '/assets/bootstrap-wysihtml5.js'
24
+ end
25
+
26
+ register_instance_option :html_attributes do
27
+ {
28
+ :cols => '48',
29
+ :rows => '3'
30
+ }
31
+ end
32
+
33
+ register_instance_option :partial do
34
+ :form_wysihtml5
35
+ end
36
+
37
+ [:config_options, :css_location, :js_location].each do |key|
38
+ register_deprecated_instance_option :"bootstrap_wysihtml5_#{key}", key
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -56,7 +56,7 @@ module RailsAdmin
56
56
  end
57
57
 
58
58
  register_instance_option :label do
59
- (@label ||= {})[::I18n.locale] ||= abstract_model.model.model_name.human(:default => abstract_model.model.model_name.demodulize.underscore.humanize)
59
+ (@label ||= {})[::I18n.locale] ||= abstract_model.model.model_name.human
60
60
  end
61
61
 
62
62
  register_instance_option :label_plural do
@@ -3,9 +3,11 @@ class RailsAdmin::History < ActiveRecord::Base
3
3
 
4
4
  IGNORED_ATTRS = Set[:id, :created_at, :created_on, :deleted_at, :updated_at, :updated_on, :deleted_on]
5
5
 
6
- attr_accessible :message, :item, :table, :username
6
+ if defined?(ActiveModel::MassAssignmentSecurity) && ancestors.include?(ActiveModel::MassAssignmentSecurity)
7
+ attr_accessible :message, :item, :table, :username
8
+ end
7
9
 
8
- default_scope order('id DESC')
10
+ default_scope { order('id DESC') }
9
11
 
10
12
  def self.latest
11
13
  self.limit(100)
@@ -1,8 +1,8 @@
1
1
  module RailsAdmin
2
2
  class Version
3
3
  MAJOR = 0 unless defined? MAJOR
4
- MINOR = 4 unless defined? MINOR
5
- PATCH = 9 unless defined? PATCH
4
+ MINOR = 5 unless defined? MINOR
5
+ PATCH = 0 unless defined? PATCH
6
6
  PRE = nil unless defined? PRE
7
7
 
8
8
  class << self
@@ -294,6 +294,27 @@ describe RailsAdmin::MainController do
294
294
  end
295
295
  end
296
296
 
297
+ describe "satisfy_strong_params!" do
298
+ before do
299
+ ActionController::Parameters.permit_all_parameters = false
300
+ end
301
+
302
+ after do
303
+ ActionController::Parameters.permit_all_parameters = true
304
+ end
305
+
306
+ it "enforces permit!" do
307
+ controller.params = HashWithIndifferentAccess.new({
308
+ "model_name"=>"player",
309
+ "player"=>{ "name" => "foo" }
310
+ })
311
+ controller.send(:get_model)
312
+ expect(controller.params['player'].permitted?).to be_false
313
+ controller.send(:satisfy_strong_params!)
314
+ expect(controller.params['player'].permitted?).to be_true
315
+ end
316
+ end
317
+
297
318
  it "allows for delete method with Carrierwave" do
298
319
 
299
320
  RailsAdmin.config FieldTest do
@@ -1,7 +1,7 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '~> 3.2'
4
- gem 'strong_parameters', '>= 0.1.6'
3
+ gem 'rails', '~> 4.0.0'
4
+ gem 'rack-cache', :require => 'rack/cache'
5
5
 
6
6
  group :active_record do
7
7
  platforms :jruby do
@@ -20,8 +20,8 @@ group :active_record do
20
20
 
21
21
  platforms :ruby, :mswin, :mingw do
22
22
  case ENV['CI_DB_ADAPTER']
23
- when 'mysql'
24
- gem 'mysql', '~> 2.8.1'
23
+ when 'mysql2'
24
+ gem 'mysql2', '~> 0.3.11'
25
25
  when 'postgresql'
26
26
  gem 'pg', '>= 0.14'
27
27
  else
@@ -31,13 +31,14 @@ group :active_record do
31
31
  end
32
32
 
33
33
  group :mongoid do
34
- gem 'mongoid', '>= 3.0'
34
+ gem 'mongoid', github: 'mongoid/mongoid'
35
35
  gem 'mongoid-paperclip', '>= 0.0.8', :require => 'mongoid_paperclip'
36
- gem 'carrierwave-mongoid', '>= 0.4', :require => 'carrierwave/mongoid'
36
+ gem 'mongoid-grid_fs', github: 'ahoward/mongoid-grid_fs'
37
+ gem 'carrierwave-mongoid', github: 'jnicklas/carrierwave-mongoid', :require => 'carrierwave/mongoid'
37
38
  end
38
39
 
39
40
  gem 'carrierwave', '>= 0.8'
40
- gem 'devise', '>= 2.2'
41
+ gem 'devise', '~> 3.0.0.rc'
41
42
  gem 'dragonfly', '>= 0.9'
42
43
  gem 'mini_magick', '>= 3.4'
43
44
  gem 'mlb', '>= 0.6'
@@ -47,8 +48,8 @@ gem 'rails_admin', :path => '../../'
47
48
  # Gems used only for assets and not required
48
49
  # in production environments by default.
49
50
  group :assets do
50
- gem 'sass-rails', '~> 3.2'
51
- gem 'coffee-rails', '~> 3.2'
51
+ gem 'sass-rails', '~> 4.0.0'
52
+ gem 'coffee-rails', '~> 4.0.0'
52
53
 
53
54
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
54
55
  # gem 'therubyracer'
@@ -1,4 +1,3 @@
1
1
  class AnotherFieldTest < ActiveRecord::Base
2
2
  has_many :nested_field_tests, :inverse_of => :another_field_test
3
- attr_accessible :nested_field_test_ids
4
3
  end
@@ -1,6 +1,4 @@
1
1
  class Ball < ActiveRecord::Base
2
- attr_accessible :color
3
-
4
2
  validates_presence_of :color, :on => :create
5
3
 
6
4
  def to_param
@@ -1,5 +1,3 @@
1
1
  class Category < ActiveRecord::Base
2
- attr_accessible :parent_category_id
3
-
4
2
  belongs_to :parent_category, :class_name => "Category"
5
3
  end
@@ -2,8 +2,6 @@ module Cms
2
2
  class BasicPage < ActiveRecord::Base
3
3
  self.table_name = :cms_basic_pages
4
4
 
5
- attr_accessible :title, :content
6
-
7
5
  validates :title, :content, :presence => true
8
6
  end
9
7
  end
@@ -1,5 +1,3 @@
1
1
  class Comment < ActiveRecord::Base
2
- attr_accessible :commentable_id, :commentable_type, :content
3
-
4
2
  belongs_to :commentable, :polymorphic => true
5
3
  end
@@ -1,3 +1,3 @@
1
1
  class Comment::Confirmed < Comment
2
- default_scope where(:content => 'something')
2
+ default_scope { where(:content => 'something') }
3
3
  end
@@ -5,8 +5,6 @@ class Division < ActiveRecord::Base
5
5
  self.primary_key = :custom_id
6
6
  end
7
7
 
8
- attr_accessible :name, :league, :custom_league_id, :team_ids
9
-
10
8
  belongs_to :league, :foreign_key => 'custom_league_id'
11
9
  has_many :teams
12
10
 
@@ -1,6 +1,4 @@
1
1
  class Draft < ActiveRecord::Base
2
- attr_accessible :player_id, :team_id, :date, :round, :pick, :overall, :college, :notes
3
-
4
2
  belongs_to :team
5
3
  belongs_to :player
6
4
 
@@ -1,6 +1,4 @@
1
1
  class Fan < ActiveRecord::Base
2
- attr_accessible :name, :team_ids
3
-
4
2
  has_and_belongs_to_many :teams
5
3
 
6
4
  validates_presence_of(:name)
@@ -1,9 +1,4 @@
1
1
  class FieldTest < ActiveRecord::Base
2
- basic_accessible_fields = [:comment_attributes, :nested_field_tests_attributes, :dragonfly_asset, :remove_dragonfly_asset, :retained_dragonfly_asset, :carrierwave_asset, :carrierwave_asset_cache, :remove_carrierwave_asset, :paperclip_asset, :delete_paperclip_asset, :comment_id, :string_field, :text_field, :integer_field, :float_field, :decimal_field, :datetime_field, :timestamp_field, :time_field, :date_field, :boolean_field, :created_at, :updated_at, :format]
3
- attr_accessible *basic_accessible_fields
4
- attr_accessible *(basic_accessible_fields + [:restricted_field, {:as => :custom_role}])
5
- attr_accessible *(basic_accessible_fields + [:protected_field, {:as => :extra_safe_role}])
6
-
7
2
  has_many :nested_field_tests, :dependent => :destroy, :inverse_of => :field_test
8
3
  accepts_nested_attributes_for :nested_field_tests, :allow_destroy => true
9
4
 
@@ -1,6 +1,4 @@
1
1
  class Image < ActiveRecord::Base
2
- attr_accessible :file
3
-
4
2
  has_attached_file :file, :styles => { :medium => "300x300>", :thumb => "100x100>" }
5
3
  validates_attachment_presence :file
6
4
  end
@@ -1,8 +1,6 @@
1
1
  class League < ActiveRecord::Base
2
- attr_accessible :name, :division_ids, :team_ids, :created_at
3
-
4
2
  has_many :divisions, :foreign_key => 'custom_league_id'
5
- has_many :teams, :through => :divisions, :readonly => true
3
+ has_many :teams, ->{ readonly }, :through => :divisions
6
4
 
7
5
  validates_presence_of(:name)
8
6
 
@@ -1,6 +1,4 @@
1
1
  class NestedFieldTest < ActiveRecord::Base
2
- attr_accessible :title, :field_test_id, :another_field_test_id, :comment_attributes
3
-
4
2
  belongs_to :field_test, :inverse_of => :nested_field_tests
5
3
  belongs_to :another_field_test, :inverse_of => :nested_field_tests
6
4
  has_one :comment, :as => :commentable
@@ -1,7 +1,4 @@
1
1
  class Player < ActiveRecord::Base
2
- attr_accessible :name, :team_id, :position, :number, :retired, :injured, :born_on, :notes, :comment_ids, :created_at
3
- attr_protected :suspended
4
-
5
2
  belongs_to :team, :inverse_of => :players
6
3
  has_one :draft, :dependent => :destroy
7
4
  has_many :comments, :as => :commentable
@@ -2,10 +2,7 @@
2
2
 
3
3
 
4
4
  class Team < ActiveRecord::Base
5
- attr_accessible :name, :division, :division_id, :logo_url, :manager, :ballpark, :mascot, :founded, :wins, :losses, :win_percentage, :revenue, :color, :custom_field, :fan_ids, :player_ids, :comment_ids
6
-
7
-
8
- has_many :players, :inverse_of => :team, :order => :id
5
+ has_many :players, -> { order :id }, :inverse_of => :team
9
6
  has_and_belongs_to_many :fans
10
7
  has_many :comments, :as => :commentable
11
8
 
@@ -5,10 +5,6 @@ class User < ActiveRecord::Base
5
5
 
6
6
  serialize :roles, Array
7
7
 
8
- # Setup accessible (or protected) attributes for your model
9
- attr_accessible :email, :password, :password_confirmation, :remember_me, :roles, :avatar
10
-
11
-
12
8
  # Add Paperclip support for avatars
13
9
  has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" }
14
10
 
@@ -2,5 +2,4 @@ class AnotherFieldTest
2
2
  include Mongoid::Document
3
3
 
4
4
  has_many :nested_field_tests, :inverse_of => :another_field_test
5
- attr_accessible :nested_field_test_ids
6
5
  end
@@ -4,8 +4,6 @@ class Ball
4
4
 
5
5
  field :color, :type => String
6
6
 
7
- attr_accessible :color
8
-
9
7
  validates_presence_of :color, :on => :create
10
8
 
11
9
  def to_param
@@ -1,7 +1,5 @@
1
1
  class Category
2
2
  include Mongoid::Document
3
3
 
4
- attr_accessible :parent_category_id
5
-
6
4
  belongs_to :parent_category, :class_name => "Category"
7
5
  end
@@ -5,8 +5,6 @@ module Cms
5
5
  field :content, :type => String
6
6
  include Mongoid::Timestamps
7
7
 
8
- attr_accessible :title, :content
9
-
10
8
  validates :title, :content, :presence => true
11
9
  end
12
10
  end
@@ -3,7 +3,5 @@ class Comment
3
3
  field :content, :type => String
4
4
  include Mongoid::Timestamps
5
5
 
6
- attr_accessible :commentable_id, :commentable_type, :content
7
-
8
6
  belongs_to :commentable, :polymorphic => true
9
7
  end
@@ -4,8 +4,6 @@ class Division
4
4
 
5
5
  field :name, :type => String
6
6
 
7
- attr_accessible :name, :league, :custom_league_id, :team_ids
8
-
9
7
  belongs_to :league, :foreign_key => 'custom_league_id'
10
8
  has_many :teams
11
9
 
@@ -11,8 +11,6 @@ class Draft
11
11
  field :college, :type => String
12
12
  field :notes, :type => String
13
13
 
14
- attr_accessible :player_id, :team_id, :date, :round, :pick, :overall, :college, :notes
15
-
16
14
  validates_presence_of(:player_id, :only_integer => true)
17
15
  validates_presence_of(:team_id, :only_integer => true)
18
16
  validates_presence_of(:date)
@@ -4,8 +4,6 @@ class Fan
4
4
 
5
5
  field :name, :type => String
6
6
 
7
- attr_accessible :name, :team_ids
8
-
9
7
  has_and_belongs_to_many :teams
10
8
 
11
9
  validates_presence_of(:name)
@@ -1,6 +1,7 @@
1
1
  class FieldTest
2
2
  include Mongoid::Document
3
3
  include Mongoid::Paperclip
4
+ include ActiveModel::ForbiddenAttributesProtection
4
5
 
5
6
  field :name, :type => String
6
7
  field :title, :type => String
@@ -31,11 +32,6 @@ class FieldTest
31
32
  field :protected_field, :type => String
32
33
  has_mongoid_attached_file :paperclip_asset, :styles => { :thumb => "100x100>" }
33
34
 
34
- basic_accessible_fields = [:comment_attributes, :nested_field_tests_attributes, :embed_attributes, :embeds_attributes, :dragonfly_asset, :remove_dragonfly_asset, :retained_dragonfly_asset, :carrierwave_asset, :carrierwave_asset_cache, :remove_carrierwave_asset, :paperclip_asset, :delete_paperclip_asset, :comment_id, :name, :array_field, :big_decimal_field, :boolean_field, :bson_object_id_field, :bson_binary_field, :date_field, :datetime_field, :time_with_zone_field, :default_field, :float_field, :hash_field, :integer_field, :object_field, :range_field, :string_field, :symbol_field, :text_field, :time_field, :created_at, :updated_at, :format]
35
- attr_accessible *basic_accessible_fields
36
- attr_accessible *(basic_accessible_fields + [:restricted_field, {:as => :custom_role}])
37
- attr_accessible *(basic_accessible_fields + [:protected_field, {:as => :extra_safe_role}])
38
-
39
35
  has_many :nested_field_tests, :dependent => :destroy, :inverse_of => :field_test, :autosave => true
40
36
  accepts_nested_attributes_for :nested_field_tests, :allow_destroy => true
41
37
 
@@ -2,8 +2,6 @@ class Image
2
2
  include Mongoid::Document
3
3
  include Mongoid::Paperclip
4
4
 
5
- attr_accessible :file
6
-
7
5
  has_mongoid_attached_file :file, :styles => { :medium => "300x300>", :thumb => "100x100>" }
8
6
  validates_attachment_presence :file
9
7
  end
@@ -4,8 +4,6 @@ class League
4
4
  field :name, :type => String
5
5
  include Mongoid::Timestamps
6
6
 
7
- attr_accessible :name, :division_ids, :team_ids, :created_at
8
-
9
7
  has_many :divisions, :foreign_key => 'custom_league_id'
10
8
 
11
9
  validates_presence_of(:name)
@@ -6,8 +6,6 @@ class NestedFieldTest
6
6
  belongs_to :another_field_test, :inverse_of => :nested_field_tests
7
7
  include Mongoid::Timestamps
8
8
 
9
- attr_accessible :title, :field_test_id, :another_field_test_id, :comment_attributes
10
-
11
9
  has_one :comment, :as => :commentable, :autosave => true
12
10
  accepts_nested_attributes_for :comment, :allow_destroy => true, :reject_if => proc { |attributes| attributes["content"].blank? }
13
11
  end
@@ -1,6 +1,7 @@
1
1
  class Player
2
2
  include Mongoid::Document
3
3
  include Mongoid::Timestamps
4
+ include ActiveModel::ForbiddenAttributesProtection
4
5
 
5
6
  field :deleted_at, :type => DateTime
6
7
  belongs_to :team, :inverse_of => :players
@@ -13,9 +14,6 @@ class Player
13
14
  field :notes, :type => String
14
15
  field :suspended, :type => Boolean, :default => false
15
16
 
16
- attr_accessible :name, :team_id, :position, :number, :retired, :injured, :born_on, :notes, :comment_ids, :created_at
17
- attr_protected :suspended
18
-
19
17
  validates_presence_of(:name)
20
18
  validates_numericality_of(:number, :only_integer => true)
21
19
  validates_uniqueness_of(:number, :scope => :team_id, :message => "There is already a player with that number on this team")
@@ -18,8 +18,6 @@ class Team
18
18
  field :color, :type => String
19
19
  field :custom_field, :type => String
20
20
 
21
- attr_accessible :name, :division, :division_id, :logo_url, :manager, :ballpark, :mascot, :founded, :wins, :losses, :win_percentage, :revenue, :color, :custom_field, :fan_ids, :player_ids, :comment_ids
22
-
23
21
  has_many :players, :inverse_of => :team, :order => :_id.asc
24
22
  has_and_belongs_to_many :fans
25
23
  has_many :comments, :as => :commentable