obitum-rails_admin 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. data/Gemfile +1 -8
  2. data/README.md +6 -2
  3. data/app/assets/javascripts/rails_admin/custom/ui.js +5 -5
  4. data/app/assets/javascripts/rails_admin/jquery-ui-1.8.16.custom.js +4727 -4727
  5. data/app/assets/javascripts/rails_admin/jquery.colorpicker.js +484 -484
  6. data/app/assets/javascripts/rails_admin/jquery.pjax.js +250 -85
  7. data/app/assets/javascripts/rails_admin/jquery.ui.timepicker.js +1371 -1219
  8. data/app/assets/javascripts/rails_admin/ra.filter-box.js +30 -30
  9. data/app/assets/javascripts/rails_admin/ra.filtering-select.js +11 -11
  10. data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.coffee +40 -0
  11. data/app/assets/javascripts/rails_admin/ra.remote-form.js +41 -39
  12. data/app/assets/javascripts/rails_admin/rails_admin.js.erb +4 -3
  13. data/app/assets/javascripts/rails_admin/themes/default/ui.js +6 -6
  14. data/app/assets/javascripts/rails_admin/ui.js.coffee +44 -16
  15. data/app/assets/stylesheets/rails_admin/base/README +2 -2
  16. data/app/assets/stylesheets/rails_admin/base/theming.css.scss +226 -113
  17. data/app/assets/stylesheets/rails_admin/custom/mixins.css.scss +1 -1
  18. data/app/assets/stylesheets/rails_admin/custom/theming.css.scss +2 -2
  19. data/app/assets/stylesheets/rails_admin/custom/variables.css.scss +3 -3
  20. data/app/assets/stylesheets/rails_admin/imports.css.scss.erb +36 -1
  21. data/app/assets/stylesheets/rails_admin/jquery.ui.timepicker.css.scss +16 -0
  22. data/app/assets/stylesheets/rails_admin/ra.filtering-multiselect.css.scss +2 -2
  23. data/app/assets/stylesheets/rails_admin/themes/default/mixins.css.scss +1 -1
  24. data/app/assets/stylesheets/rails_admin/themes/default/theming.css.scss +2 -2
  25. data/app/assets/stylesheets/rails_admin/themes/default/variables.css.scss +3 -3
  26. data/app/controllers/rails_admin/application_controller.rb +13 -18
  27. data/app/controllers/rails_admin/main_controller.rb +15 -16
  28. data/app/helpers/rails_admin/application_helper.rb +67 -41
  29. data/app/helpers/rails_admin/form_builder.rb +31 -29
  30. data/app/helpers/rails_admin/main_helper.rb +4 -4
  31. data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +12 -11
  32. data/app/views/layouts/rails_admin/application.html.haml +29 -29
  33. data/app/views/rails_admin/main/_dashboard_history.html.haml +1 -1
  34. data/app/views/rails_admin/main/_delete_notice.html.haml +4 -5
  35. data/app/views/rails_admin/main/_form_colorpicker.html.haml +2 -1
  36. data/app/views/rails_admin/main/_form_datetime.html.haml +1 -1
  37. data/app/views/rails_admin/main/_form_enumeration.html.haml +1 -1
  38. data/app/views/rails_admin/main/_form_field.html.haml +1 -1
  39. data/app/views/rails_admin/main/_form_file_upload.html.haml +3 -2
  40. data/app/views/rails_admin/main/_form_filtering_multiselect.html.haml +6 -4
  41. data/app/views/rails_admin/main/_form_filtering_select.html.haml +6 -5
  42. data/app/views/rails_admin/main/_form_nested_many.html.haml +41 -6
  43. data/app/views/rails_admin/main/_form_nested_one.html.haml +34 -5
  44. data/app/views/rails_admin/main/_form_text.html.haml +3 -3
  45. data/app/views/rails_admin/main/_submit_buttons.html.haml +6 -4
  46. data/app/views/rails_admin/main/bulk_delete.html.haml +7 -3
  47. data/app/views/rails_admin/main/dashboard.html.haml +4 -4
  48. data/app/views/rails_admin/main/delete.html.haml +7 -3
  49. data/app/views/rails_admin/main/edit.html.haml +1 -1
  50. data/app/views/rails_admin/main/export.html.haml +57 -53
  51. data/app/views/rails_admin/main/history.html.haml +8 -8
  52. data/app/views/rails_admin/main/index.html.haml +22 -21
  53. data/app/views/rails_admin/main/new.html.haml +1 -1
  54. data/app/views/rails_admin/main/show.html.haml +2 -2
  55. data/config/initializers/active_record_extensions.rb +2 -2
  56. data/config/initializers/haml.rb +0 -1
  57. data/config/locales/rails_admin.en.yml +5 -5
  58. data/lib/generators/rails_admin/templates/initializer.erb +7 -7
  59. data/lib/rails_admin/abstract_model.rb +36 -53
  60. data/lib/rails_admin/adapters/active_record/abstract_object.rb +32 -0
  61. data/lib/rails_admin/adapters/active_record.rb +56 -137
  62. data/lib/rails_admin/config/actions/base.rb +40 -28
  63. data/lib/rails_admin/config/actions/bulk_delete.rb +10 -11
  64. data/lib/rails_admin/config/actions/dashboard.rb +9 -5
  65. data/lib/rails_admin/config/actions/delete.rb +12 -9
  66. data/lib/rails_admin/config/actions/edit.rb +13 -9
  67. data/lib/rails_admin/config/actions/export.rb +9 -6
  68. data/lib/rails_admin/config/actions/history_index.rb +9 -5
  69. data/lib/rails_admin/config/actions/history_show.rb +9 -5
  70. data/lib/rails_admin/config/actions/index.rb +23 -13
  71. data/lib/rails_admin/config/actions/new.rb +14 -10
  72. data/lib/rails_admin/config/actions/show.rb +10 -5
  73. data/lib/rails_admin/config/actions/show_in_app.rb +9 -4
  74. data/lib/rails_admin/config/actions.rb +16 -16
  75. data/lib/rails_admin/config/configurable.rb +92 -0
  76. data/lib/rails_admin/config/fields/association.rb +6 -23
  77. data/lib/rails_admin/config/fields/base.rb +58 -40
  78. data/lib/rails_admin/config/fields/factories/belongs_to_association.rb +26 -0
  79. data/lib/rails_admin/config/fields/factories/carrierwave.rb +21 -2
  80. data/lib/rails_admin/config/fields/factories/devise.rb +9 -12
  81. data/lib/rails_admin/config/fields/factories/dragonfly.rb +13 -7
  82. data/lib/rails_admin/config/fields/factories/paperclip.rb +14 -15
  83. data/lib/rails_admin/config/fields/group.rb +16 -3
  84. data/lib/rails_admin/config/fields/types/belongs_to_association.rb +2 -2
  85. data/lib/rails_admin/config/fields/types/carrierwave.rb +0 -9
  86. data/lib/rails_admin/config/fields/types/color.rb +3 -3
  87. data/lib/rails_admin/config/fields/types/dragonfly.rb +1 -19
  88. data/lib/rails_admin/config/fields/types/file_upload.rb +7 -11
  89. data/lib/rails_admin/config/fields/types/has_many_association.rb +1 -6
  90. data/lib/rails_admin/config/fields/types/has_one_association.rb +4 -4
  91. data/lib/rails_admin/config/fields/types/paperclip.rb +0 -18
  92. data/lib/rails_admin/config/fields/types/password.rb +2 -2
  93. data/lib/rails_admin/config/fields/types/polymorphic_association.rb +2 -2
  94. data/lib/rails_admin/config/fields/types/text.rb +2 -2
  95. data/lib/rails_admin/config/fields.rb +7 -17
  96. data/lib/rails_admin/config/has_fields.rb +9 -9
  97. data/lib/rails_admin/config/has_groups.rb +2 -2
  98. data/lib/rails_admin/config/hideable.rb +2 -2
  99. data/lib/rails_admin/config/model.rb +23 -17
  100. data/lib/rails_admin/config/proxyable/proxy.rb +43 -0
  101. data/lib/rails_admin/config/proxyable.rb +12 -0
  102. data/lib/rails_admin/config/sections/base.rb +14 -4
  103. data/lib/rails_admin/config.rb +38 -9
  104. data/lib/rails_admin/extension.rb +1 -1
  105. data/lib/rails_admin/extensions/history/auditing_adapter.rb +6 -6
  106. data/lib/rails_admin/extensions/history/history.rb +2 -1
  107. data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +13 -13
  108. data/lib/rails_admin/support/csv_converter.rb +6 -6
  109. data/lib/rails_admin/version.rb +1 -1
  110. data/lib/rails_admin.rb +0 -5
  111. data/spec/controllers/main_controller_spec.rb +7 -7
  112. data/spec/dummy_app/Gemfile +10 -7
  113. data/spec/dummy_app/Rakefile +1 -1
  114. data/spec/dummy_app/app/assets/images/rails.png +0 -0
  115. data/spec/dummy_app/app/assets/javascripts/application.js +15 -0
  116. data/spec/dummy_app/app/assets/stylesheets/application.css +13 -0
  117. data/spec/dummy_app/app/controllers/players_controller.rb +1 -1
  118. data/spec/dummy_app/app/models/cms/basic_page.rb +1 -1
  119. data/spec/dummy_app/app/models/division.rb +5 -1
  120. data/spec/dummy_app/app/models/field_test.rb +4 -4
  121. data/spec/dummy_app/app/models/nested_field_test.rb +3 -0
  122. data/spec/dummy_app/app/models/player.rb +3 -3
  123. data/spec/dummy_app/app/views/layouts/application.html.erb +3 -2
  124. data/spec/dummy_app/app/views/players/show.html.haml +1 -1
  125. data/spec/dummy_app/config/application.rb +20 -5
  126. data/spec/dummy_app/config/database.yml +5 -2
  127. data/spec/dummy_app/config/environments/development.rb +11 -1
  128. data/spec/dummy_app/config/environments/production.rb +19 -3
  129. data/spec/dummy_app/config/environments/test.rb +5 -7
  130. data/spec/dummy_app/config/initializers/devise.rb +6 -0
  131. data/spec/dummy_app/config/initializers/inflections.rb +5 -0
  132. data/spec/dummy_app/config/initializers/secret_token.rb +1 -1
  133. data/spec/dummy_app/{foo/test/dummy/config → config}/initializers/wrap_parameters.rb +1 -1
  134. data/spec/dummy_app/config/routes.rb +1 -1
  135. data/spec/dummy_app/db/migrate/00000000000006_devise_create_users.rb +35 -5
  136. data/spec/dummy_app/db/migrate/20120118122004_add_categories.rb +1 -1
  137. data/spec/dummy_app/doc/README_FOR_APP +2 -0
  138. data/spec/dummy_app/public/404.html +26 -0
  139. data/spec/dummy_app/{foo/test/dummy/public → public}/422.html +0 -0
  140. data/spec/dummy_app/{foo/test/dummy/public → public}/500.html +0 -1
  141. data/spec/dummy_app/public/favicon.ico +0 -0
  142. data/spec/dummy_app/public/robots.txt +5 -0
  143. data/spec/helpers/application_helper_spec.rb +107 -42
  144. data/spec/{requests → integration}/authorization/cancan_spec.rb +4 -5
  145. data/spec/{requests → integration}/basic/bulk_action/rails_admin_basic_bulk_action_spec.rb +0 -0
  146. data/spec/{requests → integration}/basic/bulk_destroy/rails_admin_basic_bulk_destroy_spec.rb +3 -16
  147. data/spec/{requests → integration}/basic/create/rails_admin_basic_create_spec.rb +0 -2
  148. data/spec/{requests → integration}/basic/create/rails_admin_namespaced_model_create_spec.rb +0 -16
  149. data/spec/{requests → integration}/basic/delete/rails_admin_basic_delete_spec.rb +0 -0
  150. data/spec/{requests → integration}/basic/destroy/rails_admin_basic_destroy_spec.rb +0 -0
  151. data/spec/{requests → integration}/basic/edit/rails_admin_basic_edit_spec.rb +2 -2
  152. data/spec/{requests → integration}/basic/export/rails_admin_basic_export_spec.rb +1 -1
  153. data/spec/{requests → integration}/basic/list/rails_admin_basic_list_spec.rb +12 -38
  154. data/spec/{requests → integration}/basic/new/rails_admin_basic_new_spec.rb +0 -0
  155. data/spec/{requests → integration}/basic/new/rails_admin_namespaced_model_new_spec.rb +0 -0
  156. data/spec/{requests → integration}/basic/show/rails_admin_basic_show_spec.rb +1 -2
  157. data/spec/{requests → integration}/basic/update/rails_admin_basic_update_spec.rb +2 -2
  158. data/spec/{requests → integration}/config/edit/rails_admin_config_edit_spec.rb +65 -24
  159. data/spec/{requests → integration}/config/list/rails_admin_config_list_spec.rb +2 -2
  160. data/spec/{requests → integration}/config/show/rails_admin_config_show_spec.rb +20 -0
  161. data/spec/{requests → integration}/history/rails_admin_history_spec.rb +3 -3
  162. data/spec/{requests → integration}/rails_admin_spec.rb +8 -41
  163. data/spec/{requests → integration}/relation_spec.rb +0 -0
  164. data/spec/spec_helper.rb +13 -31
  165. data/spec/{lib → unit/adapters/active_record}/abstract_object_spec.rb +17 -5
  166. data/spec/unit/adapters/active_record_spec.rb +53 -0
  167. data/spec/{requests/actions.rb → unit/config/actions_spec.rb} +47 -31
  168. data/spec/unit/config/fields/base_spec.rb +291 -0
  169. data/spec/unit/config/model_spec.rb +75 -0
  170. data/spec/unit/config/sections_spec.rb +123 -0
  171. data/spec/{lib/rails_admin_spec.rb → unit/config_spec.rb} +65 -93
  172. metadata +127 -223
  173. data/app/assets/javascripts/rails_admin/jquery_nested_form.js +0 -58
  174. data/app/views/layouts/rails_admin/_navigation.html.haml +0 -17
  175. data/lib/rails_admin/abstract_object.rb +0 -28
  176. data/lib/rails_admin/config/base.rb +0 -111
  177. data/lib/rails_admin/config/proxy.rb +0 -40
  178. data/lib/rails_admin/generic_support.rb +0 -18
  179. data/spec/dummy_app/config/initializers/quiet_assets.rb +0 -10
  180. data/spec/dummy_app/foo/Gemfile +0 -17
  181. data/spec/dummy_app/foo/MIT-LICENSE +0 -20
  182. data/spec/dummy_app/foo/README.rdoc +0 -3
  183. data/spec/dummy_app/foo/Rakefile +0 -39
  184. data/spec/dummy_app/foo/app/assets/javascripts/foo/application.js +0 -9
  185. data/spec/dummy_app/foo/app/assets/stylesheets/foo/application.css +0 -7
  186. data/spec/dummy_app/foo/app/controllers/foo/application_controller.rb +0 -4
  187. data/spec/dummy_app/foo/app/helpers/foo/application_helper.rb +0 -4
  188. data/spec/dummy_app/foo/app/models/foo/bar.rb +0 -4
  189. data/spec/dummy_app/foo/app/views/layouts/foo/application.html.erb +0 -14
  190. data/spec/dummy_app/foo/config/routes.rb +0 -2
  191. data/spec/dummy_app/foo/foo.gemspec +0 -23
  192. data/spec/dummy_app/foo/lib/foo/engine.rb +0 -5
  193. data/spec/dummy_app/foo/lib/foo/version.rb +0 -3
  194. data/spec/dummy_app/foo/lib/foo.rb +0 -4
  195. data/spec/dummy_app/foo/lib/tasks/foo_tasks.rake +0 -4
  196. data/spec/dummy_app/foo/script/rails +0 -6
  197. data/spec/dummy_app/foo/test/dummy/Rakefile +0 -7
  198. data/spec/dummy_app/foo/test/dummy/app/assets/javascripts/application.js +0 -9
  199. data/spec/dummy_app/foo/test/dummy/app/assets/stylesheets/application.css +0 -7
  200. data/spec/dummy_app/foo/test/dummy/app/controllers/application_controller.rb +0 -3
  201. data/spec/dummy_app/foo/test/dummy/app/helpers/application_helper.rb +0 -2
  202. data/spec/dummy_app/foo/test/dummy/app/views/layouts/application.html.erb +0 -14
  203. data/spec/dummy_app/foo/test/dummy/config/application.rb +0 -45
  204. data/spec/dummy_app/foo/test/dummy/config/boot.rb +0 -10
  205. data/spec/dummy_app/foo/test/dummy/config/database.yml +0 -25
  206. data/spec/dummy_app/foo/test/dummy/config/environment.rb +0 -5
  207. data/spec/dummy_app/foo/test/dummy/config/environments/development.rb +0 -30
  208. data/spec/dummy_app/foo/test/dummy/config/environments/production.rb +0 -60
  209. data/spec/dummy_app/foo/test/dummy/config/environments/test.rb +0 -39
  210. data/spec/dummy_app/foo/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  211. data/spec/dummy_app/foo/test/dummy/config/initializers/inflections.rb +0 -10
  212. data/spec/dummy_app/foo/test/dummy/config/initializers/mime_types.rb +0 -5
  213. data/spec/dummy_app/foo/test/dummy/config/initializers/secret_token.rb +0 -7
  214. data/spec/dummy_app/foo/test/dummy/config/initializers/session_store.rb +0 -8
  215. data/spec/dummy_app/foo/test/dummy/config/locales/en.yml +0 -5
  216. data/spec/dummy_app/foo/test/dummy/config/routes.rb +0 -4
  217. data/spec/dummy_app/foo/test/dummy/config.ru +0 -4
  218. data/spec/dummy_app/foo/test/dummy/db/schema.rb +0 -21
  219. data/spec/dummy_app/foo/test/dummy/public/404.html +0 -26
  220. data/spec/dummy_app/foo/test/dummy/public/favicon.ico +0 -0
  221. data/spec/dummy_app/foo/test/dummy/script/rails +0 -6
  222. data/spec/dummy_app/foo/test/fixtures/foo/bars.yml +0 -11
  223. data/spec/dummy_app/foo/test/foo_test.rb +0 -7
  224. data/spec/dummy_app/foo/test/integration/navigation_test.rb +0 -10
  225. data/spec/dummy_app/foo/test/test_helper.rb +0 -10
  226. data/spec/dummy_app/foo/test/unit/foo/bar_test.rb +0 -9
  227. data/spec/generator_helpers.rb +0 -30
  228. data/spec/generators/install_generator_spec.rb +0 -85
  229. data/spec/generators/uninstall_generator_spec.rb +0 -35
  230. data/spec/lib/custom_field.rb +0 -7
  231. data/spec/requests/config/navigation/rails_admin_config_navigation_spec.rb +0 -107
  232. data/spec/requests/config/rails_admin_config_spec.rb +0 -227
@@ -1,30 +0,0 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
3
-
4
- # In the development environment your application's code is reloaded on
5
- # every request. This slows down response time but is perfect for development
6
- # since you don't have to restart the web server when you make code changes.
7
- config.cache_classes = false
8
-
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
11
-
12
- # Show full error reports and disable caching
13
- config.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
15
-
16
- # Don't care if the mailer can't send
17
- config.action_mailer.raise_delivery_errors = false
18
-
19
- # Print deprecation notices to the Rails logger
20
- config.active_support.deprecation = :log
21
-
22
- # Only use best-standards-support built into browsers
23
- config.action_dispatch.best_standards_support = :builtin
24
-
25
- # Do not compress assets
26
- config.assets.compress = false
27
-
28
- # Expands the lines which load the assets
29
- config.assets.debug = true
30
- end
@@ -1,60 +0,0 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
3
-
4
- # Code is not reloaded between requests
5
- config.cache_classes = true
6
-
7
- # Full error reports are disabled and caching is turned on
8
- config.consider_all_requests_local = false
9
- config.action_controller.perform_caching = true
10
-
11
- # Disable Rails's static asset server (Apache or nginx will already do this)
12
- config.serve_static_assets = false
13
-
14
- # Compress JavaScripts and CSS
15
- config.assets.compress = true
16
-
17
- # Don't fallback to assets pipeline if a precompiled asset is missed
18
- config.assets.compile = false
19
-
20
- # Generate digests for assets URLs
21
- config.assets.digest = true
22
-
23
- # Defaults to Rails.root.join("public/assets")
24
- # config.assets.manifest = YOUR_PATH
25
-
26
- # Specifies the header that your server uses for sending files
27
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
-
30
- # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
- # config.force_ssl = true
32
-
33
- # See everything in the log (default is :info)
34
- # config.log_level = :debug
35
-
36
- # Use a different logger for distributed setups
37
- # config.logger = SyslogLogger.new
38
-
39
- # Use a different cache store in production
40
- # config.cache_store = :mem_cache_store
41
-
42
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
43
- # config.action_controller.asset_host = "http://assets.example.com"
44
-
45
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
46
- # config.assets.precompile += %w( search.js )
47
-
48
- # Disable delivery errors, bad email addresses will be ignored
49
- # config.action_mailer.raise_delivery_errors = false
50
-
51
- # Enable threaded mode
52
- # config.threadsafe!
53
-
54
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
55
- # the I18n.default_locale when a translation can not be found)
56
- config.i18n.fallbacks = true
57
-
58
- # Send deprecation notices to registered listeners
59
- config.active_support.deprecation = :notify
60
- end
@@ -1,39 +0,0 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
3
-
4
- # The test environment is used exclusively to run your application's
5
- # test suite. You never need to work with it otherwise. Remember that
6
- # your test database is "scratch space" for the test suite and is wiped
7
- # and recreated between test runs. Don't rely on the data there!
8
- config.cache_classes = true
9
-
10
- # Configure static asset server for tests with Cache-Control for performance
11
- config.serve_static_assets = true
12
- config.static_cache_control = "public, max-age=3600"
13
-
14
- # Log error messages when you accidentally call methods on nil
15
- config.whiny_nils = true
16
-
17
- # Show full error reports and disable caching
18
- config.consider_all_requests_local = true
19
- config.action_controller.perform_caching = false
20
-
21
- # Raise exceptions instead of rendering exception templates
22
- config.action_dispatch.show_exceptions = false
23
-
24
- # Disable request forgery protection in test environment
25
- config.action_controller.allow_forgery_protection = false
26
-
27
- # Tell Action Mailer not to deliver emails to the real world.
28
- # The :test delivery method accumulates sent emails in the
29
- # ActionMailer::Base.deliveries array.
30
- config.action_mailer.delivery_method = :test
31
-
32
- # Use SQL instead of Active Record's schema dumper when creating the test database.
33
- # This is necessary if your schema can't be completely dumped by the schema dumper,
34
- # like if you have constraints or database-specific column types
35
- # config.active_record.schema_format = :sql
36
-
37
- # Print deprecation notices to the stderr
38
- config.active_support.deprecation = :stderr
39
- end
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
- # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
-
6
- # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
- # Rails.backtrace_cleaner.remove_silencers!
@@ -1,10 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new inflection rules using the following format
4
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
6
- # inflect.plural /^(ox)$/i, '\1en'
7
- # inflect.singular /^(ox)en/i, '\1'
8
- # inflect.irregular 'person', 'people'
9
- # inflect.uncountable %w( fish sheep )
10
- # end
@@ -1,5 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new mime types for use in respond_to blocks:
4
- # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
- # Make sure the secret is at least 30 characters and all random,
6
- # no regular words or you'll be exposed to dictionary attacks.
7
- Dummy::Application.config.secret_token = 'fb5bdd912f0e030bb79e8c4449b14d0dbc0fc32619107f94721fb835b7435f74c7aee27db7ba91598f50f131c7d222787ddae144b794cf6a64a9b2b9d3c2b783'
@@ -1,8 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
-
5
- # Use the database for sessions instead of the cookie-based default,
6
- # which shouldn't be used to store highly confidential information
7
- # (create the session table with "rails generate session_migration")
8
- # Dummy::Application.config.session_store :active_record_store
@@ -1,5 +0,0 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
2
- # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
-
4
- en:
5
- hello: "Hello world"
@@ -1,4 +0,0 @@
1
- Rails.application.routes.draw do
2
-
3
- mount Foo::Engine => "/foo"
4
- end
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Dummy::Application
@@ -1,21 +0,0 @@
1
- # encoding: UTF-8
2
- # This file is auto-generated from the current state of the database. Instead
3
- # of editing this file, please use the migrations feature of Active Record to
4
- # incrementally modify your database, and then regenerate this schema definition.
5
- #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
11
- #
12
- # It's strongly recommended to check this file into your version control system.
13
-
14
- ActiveRecord::Schema.define(:version => 20111215083258) do
15
-
16
- create_table "foo_bars", :force => true do |t|
17
- t.datetime "created_at"
18
- t.datetime "updated_at"
19
- end
20
-
21
- end
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/404.html -->
21
- <div class="dialog">
22
- <h1>The page you were looking for doesn't exist.</h1>
23
- <p>You may have mistyped the address or the page may have moved.</p>
24
- </div>
25
- </body>
26
- </html>
File without changes
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
-
4
- APP_PATH = File.expand_path('../../config/application', __FILE__)
5
- require File.expand_path('../../config/boot', __FILE__)
6
- require 'rails/commands'
@@ -1,11 +0,0 @@
1
- # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
-
3
- # This model initially had no columns defined. If you add columns to the
4
- # model remove the '{}' from the fixture names and add the columns immediately
5
- # below each fixture, per the syntax in the comments below
6
- #
7
- one: {}
8
- # column: value
9
- #
10
- two: {}
11
- # column: value
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class FooTest < ActiveSupport::TestCase
4
- test "truth" do
5
- assert_kind_of Module, Foo
6
- end
7
- end
@@ -1,10 +0,0 @@
1
- require 'test_helper'
2
-
3
- class NavigationTest < ActionDispatch::IntegrationTest
4
- fixtures :all
5
-
6
- # test "the truth" do
7
- # assert true
8
- # end
9
- end
10
-
@@ -1,10 +0,0 @@
1
- # Configure Rails Environment
2
- ENV["RAILS_ENV"] = "test"
3
-
4
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
- require "rails/test_help"
6
-
7
- Rails.backtrace_cleaner.remove_silencers!
8
-
9
- # Load support files
10
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
@@ -1,9 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Foo
4
- class BarTest < ActiveSupport::TestCase
5
- # test "the truth" do
6
- # assert true
7
- # end
8
- end
9
- end
@@ -1,30 +0,0 @@
1
- module GeneratorHelpers
2
-
3
- def create_routes_file(devise_user = 'user', rails_admin_path = 'admin')
4
- File.open(File.join(destination_root, 'config', 'routes.rb'), 'w') do |f|
5
- f.puts "DummyApp::Application.routes.draw do"
6
- f.puts " devise_for :#{devise_user}s" if devise_user
7
- f.puts " mount RailsAdmin::Engine => '/#{rails_admin_path}', :as => 'rails_admin'" if rails_admin_path
8
- f.puts " root :to => '/'"
9
- f.puts "end"
10
- end
11
- end
12
-
13
- def create_config_file(devise_user = 'user')
14
- File.open(File.join(destination_root, 'config', 'initializers', 'rails_admin.rb'), 'w') do |f|
15
- f.puts %{
16
- RailsAdmin.config do |config|
17
- config.current_user_method { current_#{devise_user} }
18
- end
19
- }
20
- end
21
- end
22
-
23
- def has_route?(route)
24
- File.open(File.join(destination_root, 'config', 'routes.rb')).read.index(route)
25
- end
26
-
27
- def has_config?(config)
28
- File.open(File.join(destination_root, 'config', 'initializers', 'rails_admin.rb')).read.index(config)
29
- end
30
- end
@@ -1,85 +0,0 @@
1
- require 'spec_helper'
2
- require 'generator_helpers'
3
-
4
- describe 'RailsAdmin::InstallGenerator' do
5
- include GeneratorSpec::TestCase
6
- include GeneratorHelpers
7
-
8
- tests RailsAdmin::InstallGenerator
9
- destination ::File.expand_path("../tmp/dummy_app", __FILE__)
10
-
11
- before :all do
12
- @rails_root = Rails.configuration.root
13
- Rails.configuration.root = Pathname.new(destination_root)
14
- end
15
-
16
- after :all do
17
- Rails.configuration.root = @rails_root
18
- end
19
-
20
- context "when ran on a new app without Devise and RailsAdmin installed" do
21
- before :all do
22
- prepare_destination
23
- FileUtils.cp_r(::File.expand_path("../../dummy_app/", __FILE__), ::File.expand_path('../', Pathname.new(destination_root))) # copying dummy_app to test directory
24
- FileUtils.rm(::File.expand_path("config/initializers/rails_admin.rb", Pathname.new(destination_root)))
25
- FileUtils.rm(::File.expand_path("config/initializers/devise.rb", Pathname.new(destination_root)))
26
- create_routes_file(nil, nil)
27
- assert_no_migration 'db/migrate/create_rails_admin_histories_table.rb'
28
- assert_no_file 'config/initializers/rails_admin.rb'
29
- assert_no_file 'config/initializers/devise.rb'
30
- @output = run_generator ['admin', 'rails_admin_root']
31
- end
32
-
33
- it "creates a migration for rails_admin" do
34
- assert_migration 'db/migrate/create_rails_admin_histories_table.rb'
35
- end
36
-
37
- it "invokes devise setup" do
38
- assert @output.match /generate devise/ # we don't want to test devise route and migration generation
39
- end
40
-
41
- it "creates an initializer" do
42
- assert_file 'config/initializers/rails_admin.rb'
43
- end
44
-
45
- it "generates a route for rails_admin" do
46
- assert has_route?("mount RailsAdmin::Engine => '/rails_admin_root', :as => 'rails_admin'")
47
- end
48
-
49
- it "adds a current_user_method with given Devise user name" do
50
- assert has_config?("current_admin")
51
- end
52
- end
53
-
54
- context "when upgrading an app with Devise and RailsAdmin already installed" do
55
- before :all do
56
- prepare_destination
57
- FileUtils.cp_r(::File.expand_path("../../dummy_app/", __FILE__), ::File.expand_path('../', Pathname.new(destination_root))) # copying dummy_app to test directory
58
- FileUtils.rm(::File.expand_path("config/initializers/rails_admin.rb", Pathname.new(destination_root)))
59
- create_routes_file('old_user', 'old_admin_route')
60
- create_config_file('old_user')
61
- assert has_config?('current_old_user')
62
- assert has_route?('devise_for :old_users')
63
- assert has_route?("mount RailsAdmin::Engine => '/old_admin_route', :as => 'rails_admin'")
64
- @output = run_generator ['new_user', 'new_admin_route']
65
- end
66
-
67
- it "should update RA route (only one instance of RailsAdmin allowed)" do
68
- assert has_route?("mount RailsAdmin::Engine => '/new_admin_route', :as => 'rails_admin'")
69
- assert !has_route?("mount RailsAdmin::Engine => '/old_admin_route', :as => 'rails_admin'")
70
- end
71
-
72
- it "invokes devise setup" do
73
- assert @output.match /generate devise/
74
- end
75
-
76
- it "should create a new example config file" do
77
- assert ::File.exists?(::File.expand_path("config/initializers/rails_admin.rb.example", Pathname.new(destination_root)))
78
- end
79
-
80
- it "should update the config file with new user method" do
81
- assert has_config?('current_new_user')
82
- assert !has_config?('current_old_user')
83
- end
84
- end
85
- end
@@ -1,35 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'RailsAdmin::UninstallGenerator' do
4
- include GeneratorSpec::TestCase
5
- include GeneratorHelpers
6
-
7
- tests RailsAdmin::UninstallGenerator
8
- destination ::File.expand_path("../tmp/dummy_app", __FILE__)
9
-
10
- before :all do
11
- prepare_destination
12
- FileUtils.cp_r(::File.expand_path("../../dummy_app/", __FILE__), ::File.expand_path('../', Pathname.new(destination_root))) # copying dummy_app to test directory
13
- FileUtils.rm(::File.expand_path("config/initializers/rails_admin.rb", Pathname.new(destination_root)))
14
- create_config_file('user')
15
- create_routes_file('user', 'admin')
16
-
17
- assert_file 'config/initializers/rails_admin.rb'
18
- assert has_route?("mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'")
19
-
20
- @output = run_generator
21
- end
22
-
23
-
24
- it "creates migrations for droping histories table" do
25
- assert_migration 'db/migrate/drop_rails_admin_histories_table.rb'
26
- end
27
-
28
- it "removes config file" do
29
- assert_no_file 'config/initializers/rails_admin.rb'
30
- end
31
-
32
- it "removes rails_admin route" do
33
- assert !has_route?("mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'")
34
- end
35
- end
@@ -1,7 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "RailsAdmin external custom field" do
4
- it "should be there" do
5
- RailsAdmin.config(Team).fields.map(&:type).should include(:custom_field)
6
- end
7
- end
@@ -1,107 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "RailsAdmin Config DSL Navigation Section" do
4
-
5
- subject { page }
6
-
7
- describe "order of items" do
8
-
9
- it "should be alphabetical by default" do
10
- visit dashboard_path
11
- ["Balls", "Bars", "Basic pages", "Comments", "Divisions", "Drafts", "Fans", "Hardballs", "Leagues", "Nested field tests", "Players", "Teams", "Unscoped pages", "Users"].each_with_index do |content, i|
12
- find(:xpath, "//ul[@id='nav']/li[#{i + 1}]").should have_content(content)
13
- end
14
- end
15
-
16
- it "should be ordered by weight and alphabetical order" do
17
- RailsAdmin.config do |config|
18
- config.model Team do
19
- weight -1
20
- end
21
- end
22
- visit dashboard_path
23
- ["Teams", "Balls", "Bars", "Basic pages", "Comments", "Divisions", "Drafts", "Fans", "Hardballs", "Leagues", "Nested field tests", "Players", "Unscoped pages", "Users"].each_with_index do |content, i|
24
- find(:xpath, "//ul[@id='nav']/li[#{i + 1}]").should have_content(content)
25
- end
26
- end
27
-
28
- it "should nest menu items with parent" do
29
- RailsAdmin.config do |config|
30
- config.model Comment do
31
- parent Cms::BasicPage
32
- end
33
- end
34
- visit dashboard_path
35
- ["Balls", "Bars", "Basic pages", "Divisions", "Drafts", "Fans", "Hardballs", "Leagues", "Nested field tests", "Players", "Teams", "Unscoped pages", "Users"].each_with_index do |content, i|
36
- find(:xpath, "//ul[@id='nav']/li[#{i + 1}]").should have_content(content)
37
- end
38
- ["Basic pages", "Comments"].each_with_index do |content, i|
39
- find(:xpath, "//ul[@id='nav']/li[contains(@class, 'more')]/ul/li[#{i + 1}]").should have_content(content)
40
- end
41
- end
42
-
43
- it "should override parent label with navigation_label" do
44
- RailsAdmin.config do |config|
45
- config.model Comment do
46
- parent Cms::BasicPage
47
- end
48
- config.model Cms::BasicPage do
49
- navigation_label "CMS related"
50
- end
51
- end
52
- visit dashboard_path
53
- ["Balls", "Bars", "CMS related", "Divisions", "Drafts", "Fans", "Hardballs", "Leagues", "Nested field tests", "Players", "Teams", "Unscoped pages", "Users"].each_with_index do |content, i|
54
- find(:xpath, "//ul[@id='nav']/li[#{i + 1}]").should have_content(content)
55
- end
56
- ["Basic pages", "Comments"].each_with_index do |content, i|
57
- find(:xpath, "//ul[@id='nav']/li[contains(@class, 'more')]/ul/li[#{i + 1}]").should have_content(content)
58
- end
59
- end
60
-
61
- it "should order navigation_label item according to parent weight" do
62
- RailsAdmin.config do |config|
63
- config.model Comment do
64
- parent Cms::BasicPage
65
- end
66
- config.model Cms::BasicPage do
67
- navigation_label "CMS related"
68
- weight 1
69
- end
70
- end
71
- visit dashboard_path
72
- ["Balls", "Bars", "Divisions", "Drafts", "Fans", "Hardballs", "Leagues", "Nested field tests", "Players", "Teams", "Unscoped pages", "Users", "CMS related"].each_with_index do |content, i|
73
- find(:xpath, "//ul[@id='nav']/li[#{i + 1}]").should have_content(content)
74
- end
75
- end
76
- end
77
-
78
- describe "label for a model" do
79
-
80
- it "should be visible and sane by default" do
81
- visit dashboard_path
82
- within("#nav") do
83
- should have_selector("li a", :text => "Fan")
84
- end
85
- end
86
-
87
- it "should be editable" do
88
- RailsAdmin.config Fan do
89
- label_plural "Fan tests"
90
- end
91
- visit dashboard_path
92
- within("#nav") do
93
- should have_selector("li a", :text => "Fan tests")
94
- end
95
- end
96
-
97
- it "should be hideable" do
98
- RailsAdmin.config Fan do
99
- hide
100
- end
101
- visit dashboard_path
102
- within("#nav") do
103
- should have_no_selector("li a", :text => "Fan")
104
- end
105
- end
106
- end
107
- end