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.
- data/Gemfile +1 -8
- data/README.md +6 -2
- data/app/assets/javascripts/rails_admin/custom/ui.js +5 -5
- data/app/assets/javascripts/rails_admin/jquery-ui-1.8.16.custom.js +4727 -4727
- data/app/assets/javascripts/rails_admin/jquery.colorpicker.js +484 -484
- data/app/assets/javascripts/rails_admin/jquery.pjax.js +250 -85
- data/app/assets/javascripts/rails_admin/jquery.ui.timepicker.js +1371 -1219
- data/app/assets/javascripts/rails_admin/ra.filter-box.js +30 -30
- data/app/assets/javascripts/rails_admin/ra.filtering-select.js +11 -11
- data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.coffee +40 -0
- data/app/assets/javascripts/rails_admin/ra.remote-form.js +41 -39
- data/app/assets/javascripts/rails_admin/rails_admin.js.erb +4 -3
- data/app/assets/javascripts/rails_admin/themes/default/ui.js +6 -6
- data/app/assets/javascripts/rails_admin/ui.js.coffee +44 -16
- data/app/assets/stylesheets/rails_admin/base/README +2 -2
- data/app/assets/stylesheets/rails_admin/base/theming.css.scss +226 -113
- data/app/assets/stylesheets/rails_admin/custom/mixins.css.scss +1 -1
- data/app/assets/stylesheets/rails_admin/custom/theming.css.scss +2 -2
- data/app/assets/stylesheets/rails_admin/custom/variables.css.scss +3 -3
- data/app/assets/stylesheets/rails_admin/imports.css.scss.erb +36 -1
- data/app/assets/stylesheets/rails_admin/jquery.ui.timepicker.css.scss +16 -0
- data/app/assets/stylesheets/rails_admin/ra.filtering-multiselect.css.scss +2 -2
- data/app/assets/stylesheets/rails_admin/themes/default/mixins.css.scss +1 -1
- data/app/assets/stylesheets/rails_admin/themes/default/theming.css.scss +2 -2
- data/app/assets/stylesheets/rails_admin/themes/default/variables.css.scss +3 -3
- data/app/controllers/rails_admin/application_controller.rb +13 -18
- data/app/controllers/rails_admin/main_controller.rb +15 -16
- data/app/helpers/rails_admin/application_helper.rb +67 -41
- data/app/helpers/rails_admin/form_builder.rb +31 -29
- data/app/helpers/rails_admin/main_helper.rb +4 -4
- data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +12 -11
- data/app/views/layouts/rails_admin/application.html.haml +29 -29
- data/app/views/rails_admin/main/_dashboard_history.html.haml +1 -1
- data/app/views/rails_admin/main/_delete_notice.html.haml +4 -5
- data/app/views/rails_admin/main/_form_colorpicker.html.haml +2 -1
- data/app/views/rails_admin/main/_form_datetime.html.haml +1 -1
- data/app/views/rails_admin/main/_form_enumeration.html.haml +1 -1
- data/app/views/rails_admin/main/_form_field.html.haml +1 -1
- data/app/views/rails_admin/main/_form_file_upload.html.haml +3 -2
- data/app/views/rails_admin/main/_form_filtering_multiselect.html.haml +6 -4
- data/app/views/rails_admin/main/_form_filtering_select.html.haml +6 -5
- data/app/views/rails_admin/main/_form_nested_many.html.haml +41 -6
- data/app/views/rails_admin/main/_form_nested_one.html.haml +34 -5
- data/app/views/rails_admin/main/_form_text.html.haml +3 -3
- data/app/views/rails_admin/main/_submit_buttons.html.haml +6 -4
- data/app/views/rails_admin/main/bulk_delete.html.haml +7 -3
- data/app/views/rails_admin/main/dashboard.html.haml +4 -4
- data/app/views/rails_admin/main/delete.html.haml +7 -3
- data/app/views/rails_admin/main/edit.html.haml +1 -1
- data/app/views/rails_admin/main/export.html.haml +57 -53
- data/app/views/rails_admin/main/history.html.haml +8 -8
- data/app/views/rails_admin/main/index.html.haml +22 -21
- data/app/views/rails_admin/main/new.html.haml +1 -1
- data/app/views/rails_admin/main/show.html.haml +2 -2
- data/config/initializers/active_record_extensions.rb +2 -2
- data/config/initializers/haml.rb +0 -1
- data/config/locales/rails_admin.en.yml +5 -5
- data/lib/generators/rails_admin/templates/initializer.erb +7 -7
- data/lib/rails_admin/abstract_model.rb +36 -53
- data/lib/rails_admin/adapters/active_record/abstract_object.rb +32 -0
- data/lib/rails_admin/adapters/active_record.rb +56 -137
- data/lib/rails_admin/config/actions/base.rb +40 -28
- data/lib/rails_admin/config/actions/bulk_delete.rb +10 -11
- data/lib/rails_admin/config/actions/dashboard.rb +9 -5
- data/lib/rails_admin/config/actions/delete.rb +12 -9
- data/lib/rails_admin/config/actions/edit.rb +13 -9
- data/lib/rails_admin/config/actions/export.rb +9 -6
- data/lib/rails_admin/config/actions/history_index.rb +9 -5
- data/lib/rails_admin/config/actions/history_show.rb +9 -5
- data/lib/rails_admin/config/actions/index.rb +23 -13
- data/lib/rails_admin/config/actions/new.rb +14 -10
- data/lib/rails_admin/config/actions/show.rb +10 -5
- data/lib/rails_admin/config/actions/show_in_app.rb +9 -4
- data/lib/rails_admin/config/actions.rb +16 -16
- data/lib/rails_admin/config/configurable.rb +92 -0
- data/lib/rails_admin/config/fields/association.rb +6 -23
- data/lib/rails_admin/config/fields/base.rb +58 -40
- data/lib/rails_admin/config/fields/factories/belongs_to_association.rb +26 -0
- data/lib/rails_admin/config/fields/factories/carrierwave.rb +21 -2
- data/lib/rails_admin/config/fields/factories/devise.rb +9 -12
- data/lib/rails_admin/config/fields/factories/dragonfly.rb +13 -7
- data/lib/rails_admin/config/fields/factories/paperclip.rb +14 -15
- data/lib/rails_admin/config/fields/group.rb +16 -3
- data/lib/rails_admin/config/fields/types/belongs_to_association.rb +2 -2
- data/lib/rails_admin/config/fields/types/carrierwave.rb +0 -9
- data/lib/rails_admin/config/fields/types/color.rb +3 -3
- data/lib/rails_admin/config/fields/types/dragonfly.rb +1 -19
- data/lib/rails_admin/config/fields/types/file_upload.rb +7 -11
- data/lib/rails_admin/config/fields/types/has_many_association.rb +1 -6
- data/lib/rails_admin/config/fields/types/has_one_association.rb +4 -4
- data/lib/rails_admin/config/fields/types/paperclip.rb +0 -18
- data/lib/rails_admin/config/fields/types/password.rb +2 -2
- data/lib/rails_admin/config/fields/types/polymorphic_association.rb +2 -2
- data/lib/rails_admin/config/fields/types/text.rb +2 -2
- data/lib/rails_admin/config/fields.rb +7 -17
- data/lib/rails_admin/config/has_fields.rb +9 -9
- data/lib/rails_admin/config/has_groups.rb +2 -2
- data/lib/rails_admin/config/hideable.rb +2 -2
- data/lib/rails_admin/config/model.rb +23 -17
- data/lib/rails_admin/config/proxyable/proxy.rb +43 -0
- data/lib/rails_admin/config/proxyable.rb +12 -0
- data/lib/rails_admin/config/sections/base.rb +14 -4
- data/lib/rails_admin/config.rb +38 -9
- data/lib/rails_admin/extension.rb +1 -1
- data/lib/rails_admin/extensions/history/auditing_adapter.rb +6 -6
- data/lib/rails_admin/extensions/history/history.rb +2 -1
- data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +13 -13
- data/lib/rails_admin/support/csv_converter.rb +6 -6
- data/lib/rails_admin/version.rb +1 -1
- data/lib/rails_admin.rb +0 -5
- data/spec/controllers/main_controller_spec.rb +7 -7
- data/spec/dummy_app/Gemfile +10 -7
- data/spec/dummy_app/Rakefile +1 -1
- data/spec/dummy_app/app/assets/images/rails.png +0 -0
- data/spec/dummy_app/app/assets/javascripts/application.js +15 -0
- data/spec/dummy_app/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy_app/app/controllers/players_controller.rb +1 -1
- data/spec/dummy_app/app/models/cms/basic_page.rb +1 -1
- data/spec/dummy_app/app/models/division.rb +5 -1
- data/spec/dummy_app/app/models/field_test.rb +4 -4
- data/spec/dummy_app/app/models/nested_field_test.rb +3 -0
- data/spec/dummy_app/app/models/player.rb +3 -3
- data/spec/dummy_app/app/views/layouts/application.html.erb +3 -2
- data/spec/dummy_app/app/views/players/show.html.haml +1 -1
- data/spec/dummy_app/config/application.rb +20 -5
- data/spec/dummy_app/config/database.yml +5 -2
- data/spec/dummy_app/config/environments/development.rb +11 -1
- data/spec/dummy_app/config/environments/production.rb +19 -3
- data/spec/dummy_app/config/environments/test.rb +5 -7
- data/spec/dummy_app/config/initializers/devise.rb +6 -0
- data/spec/dummy_app/config/initializers/inflections.rb +5 -0
- data/spec/dummy_app/config/initializers/secret_token.rb +1 -1
- data/spec/dummy_app/{foo/test/dummy/config → config}/initializers/wrap_parameters.rb +1 -1
- data/spec/dummy_app/config/routes.rb +1 -1
- data/spec/dummy_app/db/migrate/00000000000006_devise_create_users.rb +35 -5
- data/spec/dummy_app/db/migrate/20120118122004_add_categories.rb +1 -1
- data/spec/dummy_app/doc/README_FOR_APP +2 -0
- data/spec/dummy_app/public/404.html +26 -0
- data/spec/dummy_app/{foo/test/dummy/public → public}/422.html +0 -0
- data/spec/dummy_app/{foo/test/dummy/public → public}/500.html +0 -1
- data/spec/dummy_app/public/favicon.ico +0 -0
- data/spec/dummy_app/public/robots.txt +5 -0
- data/spec/helpers/application_helper_spec.rb +107 -42
- data/spec/{requests → integration}/authorization/cancan_spec.rb +4 -5
- data/spec/{requests → integration}/basic/bulk_action/rails_admin_basic_bulk_action_spec.rb +0 -0
- data/spec/{requests → integration}/basic/bulk_destroy/rails_admin_basic_bulk_destroy_spec.rb +3 -16
- data/spec/{requests → integration}/basic/create/rails_admin_basic_create_spec.rb +0 -2
- data/spec/{requests → integration}/basic/create/rails_admin_namespaced_model_create_spec.rb +0 -16
- data/spec/{requests → integration}/basic/delete/rails_admin_basic_delete_spec.rb +0 -0
- data/spec/{requests → integration}/basic/destroy/rails_admin_basic_destroy_spec.rb +0 -0
- data/spec/{requests → integration}/basic/edit/rails_admin_basic_edit_spec.rb +2 -2
- data/spec/{requests → integration}/basic/export/rails_admin_basic_export_spec.rb +1 -1
- data/spec/{requests → integration}/basic/list/rails_admin_basic_list_spec.rb +12 -38
- data/spec/{requests → integration}/basic/new/rails_admin_basic_new_spec.rb +0 -0
- data/spec/{requests → integration}/basic/new/rails_admin_namespaced_model_new_spec.rb +0 -0
- data/spec/{requests → integration}/basic/show/rails_admin_basic_show_spec.rb +1 -2
- data/spec/{requests → integration}/basic/update/rails_admin_basic_update_spec.rb +2 -2
- data/spec/{requests → integration}/config/edit/rails_admin_config_edit_spec.rb +65 -24
- data/spec/{requests → integration}/config/list/rails_admin_config_list_spec.rb +2 -2
- data/spec/{requests → integration}/config/show/rails_admin_config_show_spec.rb +20 -0
- data/spec/{requests → integration}/history/rails_admin_history_spec.rb +3 -3
- data/spec/{requests → integration}/rails_admin_spec.rb +8 -41
- data/spec/{requests → integration}/relation_spec.rb +0 -0
- data/spec/spec_helper.rb +13 -31
- data/spec/{lib → unit/adapters/active_record}/abstract_object_spec.rb +17 -5
- data/spec/unit/adapters/active_record_spec.rb +53 -0
- data/spec/{requests/actions.rb → unit/config/actions_spec.rb} +47 -31
- data/spec/unit/config/fields/base_spec.rb +291 -0
- data/spec/unit/config/model_spec.rb +75 -0
- data/spec/unit/config/sections_spec.rb +123 -0
- data/spec/{lib/rails_admin_spec.rb → unit/config_spec.rb} +65 -93
- metadata +127 -223
- data/app/assets/javascripts/rails_admin/jquery_nested_form.js +0 -58
- data/app/views/layouts/rails_admin/_navigation.html.haml +0 -17
- data/lib/rails_admin/abstract_object.rb +0 -28
- data/lib/rails_admin/config/base.rb +0 -111
- data/lib/rails_admin/config/proxy.rb +0 -40
- data/lib/rails_admin/generic_support.rb +0 -18
- data/spec/dummy_app/config/initializers/quiet_assets.rb +0 -10
- data/spec/dummy_app/foo/Gemfile +0 -17
- data/spec/dummy_app/foo/MIT-LICENSE +0 -20
- data/spec/dummy_app/foo/README.rdoc +0 -3
- data/spec/dummy_app/foo/Rakefile +0 -39
- data/spec/dummy_app/foo/app/assets/javascripts/foo/application.js +0 -9
- data/spec/dummy_app/foo/app/assets/stylesheets/foo/application.css +0 -7
- data/spec/dummy_app/foo/app/controllers/foo/application_controller.rb +0 -4
- data/spec/dummy_app/foo/app/helpers/foo/application_helper.rb +0 -4
- data/spec/dummy_app/foo/app/models/foo/bar.rb +0 -4
- data/spec/dummy_app/foo/app/views/layouts/foo/application.html.erb +0 -14
- data/spec/dummy_app/foo/config/routes.rb +0 -2
- data/spec/dummy_app/foo/foo.gemspec +0 -23
- data/spec/dummy_app/foo/lib/foo/engine.rb +0 -5
- data/spec/dummy_app/foo/lib/foo/version.rb +0 -3
- data/spec/dummy_app/foo/lib/foo.rb +0 -4
- data/spec/dummy_app/foo/lib/tasks/foo_tasks.rake +0 -4
- data/spec/dummy_app/foo/script/rails +0 -6
- data/spec/dummy_app/foo/test/dummy/Rakefile +0 -7
- data/spec/dummy_app/foo/test/dummy/app/assets/javascripts/application.js +0 -9
- data/spec/dummy_app/foo/test/dummy/app/assets/stylesheets/application.css +0 -7
- data/spec/dummy_app/foo/test/dummy/app/controllers/application_controller.rb +0 -3
- data/spec/dummy_app/foo/test/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy_app/foo/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy_app/foo/test/dummy/config/application.rb +0 -45
- data/spec/dummy_app/foo/test/dummy/config/boot.rb +0 -10
- data/spec/dummy_app/foo/test/dummy/config/database.yml +0 -25
- data/spec/dummy_app/foo/test/dummy/config/environment.rb +0 -5
- data/spec/dummy_app/foo/test/dummy/config/environments/development.rb +0 -30
- data/spec/dummy_app/foo/test/dummy/config/environments/production.rb +0 -60
- data/spec/dummy_app/foo/test/dummy/config/environments/test.rb +0 -39
- data/spec/dummy_app/foo/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy_app/foo/test/dummy/config/initializers/inflections.rb +0 -10
- data/spec/dummy_app/foo/test/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy_app/foo/test/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy_app/foo/test/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy_app/foo/test/dummy/config/locales/en.yml +0 -5
- data/spec/dummy_app/foo/test/dummy/config/routes.rb +0 -4
- data/spec/dummy_app/foo/test/dummy/config.ru +0 -4
- data/spec/dummy_app/foo/test/dummy/db/schema.rb +0 -21
- data/spec/dummy_app/foo/test/dummy/public/404.html +0 -26
- data/spec/dummy_app/foo/test/dummy/public/favicon.ico +0 -0
- data/spec/dummy_app/foo/test/dummy/script/rails +0 -6
- data/spec/dummy_app/foo/test/fixtures/foo/bars.yml +0 -11
- data/spec/dummy_app/foo/test/foo_test.rb +0 -7
- data/spec/dummy_app/foo/test/integration/navigation_test.rb +0 -10
- data/spec/dummy_app/foo/test/test_helper.rb +0 -10
- data/spec/dummy_app/foo/test/unit/foo/bar_test.rb +0 -9
- data/spec/generator_helpers.rb +0 -30
- data/spec/generators/install_generator_spec.rb +0 -85
- data/spec/generators/uninstall_generator_spec.rb +0 -35
- data/spec/lib/custom_field.rb +0 -7
- data/spec/requests/config/navigation/rails_admin_config_navigation_spec.rb +0 -107
- 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,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,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,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 }
|
data/spec/generator_helpers.rb
DELETED
@@ -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
|
data/spec/lib/custom_field.rb
DELETED
@@ -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
|