active_i18n 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +105 -0
  4. data/Rakefile +35 -0
  5. data/app/assets/images/active_i18n/flags.png +0 -0
  6. data/app/assets/javascripts/active_i18n.js +1 -0
  7. data/app/assets/javascripts/active_i18n/layout.js.coffee +31 -0
  8. data/app/assets/stylesheets/active_i18n.css.sass +5 -0
  9. data/app/assets/stylesheets/active_i18n/application.css +13 -0
  10. data/app/assets/stylesheets/active_i18n/flags.css.scss +258 -0
  11. data/app/assets/stylesheets/active_i18n/list.css.sass +70 -0
  12. data/app/assets/stylesheets/active_i18n/sidebar.css.sass +60 -0
  13. data/app/assets/stylesheets/active_i18n/structure.css.sass +4 -0
  14. data/app/controllers/active_i18n/application_controller.rb +4 -0
  15. data/app/helpers/active_i18n/view_helper.rb +66 -0
  16. data/app/views/active_i18n/_content.html.haml +36 -0
  17. data/app/views/active_i18n/_sidebar.html.haml +5 -0
  18. data/app/views/layouts/active_i18n/application.html.erb +14 -0
  19. data/config/locales/en.yml +76 -0
  20. data/config/routes.rb +2 -0
  21. data/lib/active_i18n.rb +32 -0
  22. data/lib/active_i18n/active_admin.rb +28 -0
  23. data/lib/active_i18n/base_store.rb +42 -0
  24. data/lib/active_i18n/engine.rb +18 -0
  25. data/lib/active_i18n/translations_store.rb +26 -0
  26. data/lib/active_i18n/version.rb +3 -0
  27. data/lib/tasks/active_i18n_tasks.rake +4 -0
  28. data/spec/dummy/README.rdoc +261 -0
  29. data/spec/dummy/Rakefile +7 -0
  30. data/spec/dummy/app/admin/admin_users.rb +20 -0
  31. data/spec/dummy/app/admin/dashboard.rb +33 -0
  32. data/spec/dummy/app/admin/translation.rb +4 -0
  33. data/spec/dummy/app/assets/javascripts/active_admin.js +2 -0
  34. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  35. data/spec/dummy/app/assets/stylesheets/active_admin.css.scss +32 -0
  36. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  37. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  38. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  39. data/spec/dummy/app/models/admin_user.rb +17 -0
  40. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  41. data/spec/dummy/config.ru +4 -0
  42. data/spec/dummy/config/application.rb +66 -0
  43. data/spec/dummy/config/boot.rb +10 -0
  44. data/spec/dummy/config/database.yml +25 -0
  45. data/spec/dummy/config/environment.rb +5 -0
  46. data/spec/dummy/config/environments/development.rb +37 -0
  47. data/spec/dummy/config/environments/production.rb +67 -0
  48. data/spec/dummy/config/environments/test.rb +37 -0
  49. data/spec/dummy/config/initializers/active_admin.rb +210 -0
  50. data/spec/dummy/config/initializers/active_i18n.rb +3 -0
  51. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  52. data/spec/dummy/config/initializers/devise.rb +256 -0
  53. data/spec/dummy/config/initializers/inflections.rb +15 -0
  54. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  55. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  56. data/spec/dummy/config/initializers/session_store.rb +8 -0
  57. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  58. data/spec/dummy/config/locales/devise.en.yml +59 -0
  59. data/spec/dummy/config/locales/en.yml +5 -0
  60. data/spec/dummy/config/locales/en_test.yml +7 -0
  61. data/spec/dummy/config/locales/pl_test.yml +5 -0
  62. data/spec/dummy/config/routes.rb +7 -0
  63. data/spec/dummy/db/development.sqlite3 +0 -0
  64. data/spec/dummy/db/migrate/20140811102607_devise_create_admin_users.rb +48 -0
  65. data/spec/dummy/db/migrate/20140811102609_create_admin_notes.rb +17 -0
  66. data/spec/dummy/db/migrate/20140811102610_move_admin_notes_to_comments.rb +26 -0
  67. data/spec/dummy/db/schema.rb +49 -0
  68. data/spec/dummy/db/test.sqlite3 +0 -0
  69. data/spec/dummy/log/development.log +36840 -0
  70. data/spec/dummy/log/test.log +961 -0
  71. data/spec/dummy/public/404.html +26 -0
  72. data/spec/dummy/public/422.html +26 -0
  73. data/spec/dummy/public/500.html +25 -0
  74. data/spec/dummy/public/favicon.ico +0 -0
  75. data/spec/dummy/script/rails +6 -0
  76. data/spec/dummy/spec/factories/admin_users.rb +6 -0
  77. data/spec/dummy/spec/models/admin_user_spec.rb +5 -0
  78. data/spec/dummy/tmp/cache/assets/C58/410/sprockets%2F5c7886d2d5716b050cd38b9121769471 +0 -0
  79. data/spec/dummy/tmp/cache/assets/C7F/FE0/sprockets%2Fd8b50477b1b153638c7346534a0877da +0 -0
  80. data/spec/dummy/tmp/cache/assets/C8C/900/sprockets%2F1112043d14fe51296aa033bd024d0b78 +0 -0
  81. data/spec/dummy/tmp/cache/assets/C9A/D60/sprockets%2Fa62368179337c7154198e2786eeec9a8 +0 -0
  82. data/spec/dummy/tmp/cache/assets/CAD/C50/sprockets%2F8319a9f588005b0a424b90472c6a9a3f +0 -0
  83. data/spec/dummy/tmp/cache/assets/CAF/020/sprockets%2F9454bc172681345fa525aff08281b74c +0 -0
  84. data/spec/dummy/tmp/cache/assets/CB8/1D0/sprockets%2Fb510c0fc9803866436178e77582c7bad +0 -0
  85. data/spec/dummy/tmp/cache/assets/CBC/0B0/sprockets%2Fc0bba633769759659c7d4f0a2224499d +0 -0
  86. data/spec/dummy/tmp/cache/assets/CBF/620/sprockets%2F109dfac52e95799730667ba8e11e2765 +0 -0
  87. data/spec/dummy/tmp/cache/assets/CCD/670/sprockets%2F08edc1d5a073b0625304ba682985a24b +0 -0
  88. data/spec/dummy/tmp/cache/assets/CDB/040/sprockets%2Fc732474e67003a4eb840eb44c5ca9385 +0 -0
  89. data/spec/dummy/tmp/cache/assets/CDD/600/sprockets%2F65df7604a9339ce6a3d1923b472ee400 +0 -0
  90. data/spec/dummy/tmp/cache/assets/CE1/540/sprockets%2F305fa586dc7c7615d59e593120abf353 +0 -0
  91. data/spec/dummy/tmp/cache/assets/CEA/470/sprockets%2F8303f8f5f77c51100f64ff283ea6757a +0 -0
  92. data/spec/dummy/tmp/cache/assets/CEC/BA0/sprockets%2F7c5072074b471dff1cbf726f3786e548 +0 -0
  93. data/spec/dummy/tmp/cache/assets/D10/870/sprockets%2F5e7ab7f11ed7390a5ff8950121c40e49 +0 -0
  94. data/spec/dummy/tmp/cache/assets/D24/D10/sprockets%2Ff884c60f003f6ce75e3ef9f53891375a +0 -0
  95. data/spec/dummy/tmp/cache/assets/D28/200/sprockets%2Fb030b1c02160352cc756faec0ef883d5 +0 -0
  96. data/spec/dummy/tmp/cache/assets/D29/620/sprockets%2F3d664b0b71ca2fb901d77dce24215a32 +0 -0
  97. data/spec/dummy/tmp/cache/assets/D2D/2F0/sprockets%2Fd8ccd71f1767785f8489039e3d6c8a5b +0 -0
  98. data/spec/dummy/tmp/cache/assets/D33/CA0/sprockets%2F4dbc63d52f13068b8e72f3dd1107ba27 +0 -0
  99. data/spec/dummy/tmp/cache/assets/D36/2D0/sprockets%2Fcdfd2af48a61389a0dc7c751025504b7 +0 -0
  100. data/spec/dummy/tmp/cache/assets/D38/540/sprockets%2F86e1ad844bc9df4491a2a52b870421db +0 -0
  101. data/spec/dummy/tmp/cache/assets/D41/DE0/sprockets%2F9c89ee33751a67901a0ceead0d82781b +0 -0
  102. data/spec/dummy/tmp/cache/assets/D43/110/sprockets%2Fd5e364fe2e128443f5250e419af9bbc8 +0 -0
  103. data/spec/dummy/tmp/cache/assets/D44/3F0/sprockets%2F29e1206c858c89cf5453cf370dc2eca4 +0 -0
  104. data/spec/dummy/tmp/cache/assets/D45/110/sprockets%2F87892bd05e664b62bdbbc1e3704b67d9 +0 -0
  105. data/spec/dummy/tmp/cache/assets/D45/240/sprockets%2F5fa87c4a361e5f2866c52e12257c9ead +0 -0
  106. data/spec/dummy/tmp/cache/assets/D46/EB0/sprockets%2F663efa9a78c238c8a3aaf09a07d74627 +0 -0
  107. data/spec/dummy/tmp/cache/assets/D48/640/sprockets%2F9f4f18d910b678b1d0777e04cdaf6f24 +0 -0
  108. data/spec/dummy/tmp/cache/assets/D4B/C50/sprockets%2Ff28e143f4b4887e0f5e8cff05227c55b +0 -0
  109. data/spec/dummy/tmp/cache/assets/D59/D70/sprockets%2Fed9f0de1b65ae8d7ef89087c83728461 +0 -0
  110. data/spec/dummy/tmp/cache/assets/D60/F90/sprockets%2F85a232fb35c16bf87279047aa1ccbbb2 +0 -0
  111. data/spec/dummy/tmp/cache/assets/D62/770/sprockets%2F76a285eb6576ee1f11132bcd07f0eea0 +0 -0
  112. data/spec/dummy/tmp/cache/assets/D67/0C0/sprockets%2F09eed8ed6f341c0c429007ab0219ee7c +0 -0
  113. data/spec/dummy/tmp/cache/assets/D68/E10/sprockets%2F36d13da052a68af78a38a6dec93bd900 +0 -0
  114. data/spec/dummy/tmp/cache/assets/D6C/2F0/sprockets%2F107964995ee0c0bae0b46fdae574fa42 +0 -0
  115. data/spec/dummy/tmp/cache/assets/D6D/540/sprockets%2Fedbc4e34cd1e2cc70b7428678932aa92 +0 -0
  116. data/spec/dummy/tmp/cache/assets/D72/C80/sprockets%2Fa1430f4544581c9e76e56fcfdbe41c3e +0 -0
  117. data/spec/dummy/tmp/cache/assets/D7B/5F0/sprockets%2Fa4b788c26c44568cb71b3c79edc4b7f4 +0 -0
  118. data/spec/dummy/tmp/cache/assets/D8A/7E0/sprockets%2F2ce302007a5d81840ddc07b7cb1d5ffc +0 -0
  119. data/spec/dummy/tmp/cache/assets/D8F/670/sprockets%2F810ec022c6fe22bdec817bd7c0d808c1 +0 -0
  120. data/spec/dummy/tmp/cache/assets/D93/4C0/sprockets%2F857ecd2092cee11f740b3cf2e373ad2a +0 -0
  121. data/spec/dummy/tmp/cache/assets/D97/F90/sprockets%2Fc016a87d244c59a9a39ca8a90febe10b +0 -0
  122. data/spec/dummy/tmp/cache/assets/DA4/970/sprockets%2Fa93e382f3ec0e5b8cf765c062b946bcd +0 -0
  123. data/spec/dummy/tmp/cache/assets/DA8/D80/sprockets%2F0c96c0d9696bd756aad0d36bcf77db47 +0 -0
  124. data/spec/dummy/tmp/cache/assets/DBB/7C0/sprockets%2F00b6b9b17a4f12bae8eb17ef61abe731 +0 -0
  125. data/spec/dummy/tmp/cache/assets/DC7/A30/sprockets%2F5c6134fae4cb1a1dc4ae77cf661d42e9 +0 -0
  126. data/spec/dummy/tmp/cache/assets/DC9/A70/sprockets%2Fa0ca172bddf418f3ccd34a8e77725a8d +0 -0
  127. data/spec/dummy/tmp/cache/assets/DCE/840/sprockets%2F266fbe1ca258f3ccfec16753dafd4409 +0 -0
  128. data/spec/dummy/tmp/cache/assets/DDE/420/sprockets%2Ffb8b186d5bf0307f86f65fc787d2adeb +0 -0
  129. data/spec/dummy/tmp/cache/assets/DEE/CC0/sprockets%2Fa3dbe0de23a16d72f3abc3cd9388b80a +0 -0
  130. data/spec/dummy/tmp/cache/assets/DF1/BE0/sprockets%2Fcbdfaa7ea4d66d31e20da6754b4534dc +0 -0
  131. data/spec/dummy/tmp/cache/assets/DFA/E20/sprockets%2Ffe14bdb79b2a9dbf0b539198d3aba6b4 +0 -0
  132. data/spec/dummy/tmp/cache/assets/E27/B80/sprockets%2Fbced6cfc13bcfab45a1fa5b479d15486 +0 -0
  133. data/spec/dummy/tmp/cache/assets/E57/9A0/sprockets%2Fdf25986ad4babcf83acc6ac19e2a04fd +0 -0
  134. data/spec/lib/active_i18n_base_score_spec.rb +21 -0
  135. data/spec/lib/active_i18n_spec.rb +27 -0
  136. data/spec/lib/active_i18n_translations_store_spec.rb +34 -0
  137. data/spec/spec_helper.rb +15 -0
  138. metadata +471 -0
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,17 @@
1
+ class AdminUser < ActiveRecord::Base
2
+ # Include default devise modules. Others available are:
3
+ # :confirmable, :lockable, :timeoutable and :omniauthable
4
+ devise :database_authenticatable,
5
+ :recoverable, :rememberable, :trackable, :validatable
6
+
7
+ # Setup accessible (or protected) attributes for your model
8
+ attr_accessible :email, :password, :password_confirmation, :remember_me
9
+ # Include default devise modules. Others available are:
10
+ # :confirmable, :lockable, :timeoutable and :omniauthable
11
+ devise :database_authenticatable,
12
+ :recoverable, :rememberable, :trackable, :validatable
13
+
14
+ # Setup accessible (or protected) attributes for your model
15
+ attr_accessible :email, :password, :password_confirmation, :remember_me
16
+ # attr_accessible :title, :body
17
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application", :media => "all" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,4 @@
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
@@ -0,0 +1,66 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # Pick the frameworks you want:
4
+ require "active_record/railtie"
5
+ require "action_controller/railtie"
6
+ require "action_mailer/railtie"
7
+ require "active_resource/railtie"
8
+ require "sprockets/railtie"
9
+ # require "rails/test_unit/railtie"
10
+
11
+ Bundler.require(*Rails.groups)
12
+ require "active_i18n"
13
+
14
+ module Dummy
15
+ class Application < Rails::Application
16
+ # Settings in config/environments/* take precedence over those specified here.
17
+ # Application configuration should go into files in config/initializers
18
+ # -- all .rb files in that directory are automatically loaded.
19
+
20
+ # Custom directories with classes and modules you want to be autoloadable.
21
+ # config.autoload_paths += %W(#{config.root}/extras)
22
+
23
+ # Only load the plugins named here, in the order given (default is alphabetical).
24
+ # :all can be used as a placeholder for all plugins not explicitly named.
25
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
26
+
27
+ # Activate observers that should always be running.
28
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
29
+
30
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
31
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
32
+ # config.time_zone = 'Central Time (US & Canada)'
33
+
34
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
35
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
36
+ config.i18n.default_locale = :en
37
+ config.i18n.available_locales = [:pl, :de, :en, :fr]
38
+
39
+ # Configure the default encoding used in templates for Ruby 1.9.
40
+ config.encoding = "utf-8"
41
+
42
+ # Configure sensitive parameters which will be filtered from the log file.
43
+ config.filter_parameters += [:password]
44
+
45
+ # Enable escaping HTML in JSON.
46
+ config.active_support.escape_html_entities_in_json = true
47
+
48
+ # Use SQL instead of Active Record's schema dumper when creating the database.
49
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
50
+ # like if you have constraints or database-specific column types
51
+ # config.active_record.schema_format = :sql
52
+
53
+ # Enforce whitelist mode for mass assignment.
54
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
55
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
56
+ # parameters by using an attr_accessible or attr_protected declaration.
57
+ config.active_record.whitelist_attributes = true
58
+
59
+ # Enable the asset pipeline
60
+ config.assets.enabled = true
61
+
62
+ # Version of your assets, change this if you want to expire all your assets
63
+ config.assets.version = '1.0'
64
+ end
65
+ end
66
+
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,37 @@
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
+ # Raise exception on mass assignment protection for Active Record models
26
+ config.active_record.mass_assignment_sanitizer = :strict
27
+
28
+ # Log the query plan for queries taking more than this (works
29
+ # with SQLite, MySQL, and PostgreSQL)
30
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
31
+
32
+ # Do not compress assets
33
+ config.assets.compress = false
34
+
35
+ # Expands the lines which load the assets
36
+ config.assets.debug = true
37
+ end
@@ -0,0 +1,67 @@
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 nil and saved in location specified by config.assets.prefix
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
+ # Prepend all log lines with the following tags
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
39
+ # Use a different logger for distributed setups
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
+
42
+ # Use a different cache store in production
43
+ # config.cache_store = :mem_cache_store
44
+
45
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
+ # config.action_controller.asset_host = "http://assets.example.com"
47
+
48
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
+ # config.assets.precompile += %w( search.js )
50
+
51
+ # Disable delivery errors, bad email addresses will be ignored
52
+ # config.action_mailer.raise_delivery_errors = false
53
+
54
+ # Enable threaded mode
55
+ # config.threadsafe!
56
+
57
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
+ # the I18n.default_locale when a translation can not be found)
59
+ config.i18n.fallbacks = true
60
+
61
+ # Send deprecation notices to registered listeners
62
+ config.active_support.deprecation = :notify
63
+
64
+ # Log the query plan for queries taking more than this (works
65
+ # with SQLite, MySQL, and PostgreSQL)
66
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
67
+ end
@@ -0,0 +1,37 @@
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
+ # Raise exception on mass assignment protection for Active Record models
33
+ config.active_record.mass_assignment_sanitizer = :strict
34
+
35
+ # Print deprecation notices to the stderr
36
+ config.active_support.deprecation = :stderr
37
+ end
@@ -0,0 +1,210 @@
1
+ ActiveAdmin.setup do |config|
2
+
3
+ # == Site Title
4
+ #
5
+ # Set the title that is displayed on the main layout
6
+ # for each of the active admin pages.
7
+ #
8
+ config.site_title = "Dummy"
9
+
10
+ # Set the link url for the title. For example, to take
11
+ # users to your main site. Defaults to no link.
12
+ #
13
+ # config.site_title_link = "/"
14
+
15
+ # Set an optional image to be displayed for the header
16
+ # instead of a string (overrides :site_title)
17
+ #
18
+ # Note: Recommended image height is 21px to properly fit in the header
19
+ #
20
+ # config.site_title_image = "/images/logo.png"
21
+
22
+ # == Default Namespace
23
+ #
24
+ # Set the default namespace each administration resource
25
+ # will be added to.
26
+ #
27
+ # eg:
28
+ # config.default_namespace = :hello_world
29
+ #
30
+ # This will create resources in the HelloWorld module and
31
+ # will namespace routes to /hello_world/*
32
+ #
33
+ # To set no namespace by default, use:
34
+ # config.default_namespace = false
35
+ #
36
+ # Default:
37
+ # config.default_namespace = :admin
38
+ #
39
+ # You can customize the settings for each namespace by using
40
+ # a namespace block. For example, to change the site title
41
+ # within a namespace:
42
+ #
43
+ # config.namespace :admin do |admin|
44
+ # admin.site_title = "Custom Admin Title"
45
+ # end
46
+ #
47
+ # This will ONLY change the title for the admin section. Other
48
+ # namespaces will continue to use the main "site_title" configuration.
49
+
50
+ # == User Authentication
51
+ #
52
+ # Active Admin will automatically call an authentication
53
+ # method in a before filter of all controller actions to
54
+ # ensure that there is a currently logged in admin user.
55
+ #
56
+ # This setting changes the method which Active Admin calls
57
+ # within the controller.
58
+ config.authentication_method = :authenticate_admin_user!
59
+
60
+
61
+ # == Current User
62
+ #
63
+ # Active Admin will associate actions with the current
64
+ # user performing them.
65
+ #
66
+ # This setting changes the method which Active Admin calls
67
+ # to return the currently logged in user.
68
+ config.current_user_method = :current_admin_user
69
+
70
+
71
+ # == Logging Out
72
+ #
73
+ # Active Admin displays a logout link on each screen. These
74
+ # settings configure the location and method used for the link.
75
+ #
76
+ # This setting changes the path where the link points to. If it's
77
+ # a string, the strings is used as the path. If it's a Symbol, we
78
+ # will call the method to return the path.
79
+ #
80
+ # Default:
81
+ config.logout_link_path = :destroy_admin_user_session_path
82
+
83
+ # This setting changes the http method used when rendering the
84
+ # link. For example :get, :delete, :put, etc..
85
+ #
86
+ # Default:
87
+ # config.logout_link_method = :get
88
+
89
+ # == Root
90
+ #
91
+ # Set the action to call for the root path. You can set different
92
+ # roots for each namespace.
93
+ #
94
+ # Default:
95
+ # config.root_to = 'dashboard#index'
96
+
97
+ # == Admin Comments
98
+ #
99
+ # Admin comments allow you to add comments to any model for admin use.
100
+ # Admin comments are enabled by default.
101
+ #
102
+ # Default:
103
+ # config.allow_comments = true
104
+ #
105
+ # You can turn them on and off for any given namespace by using a
106
+ # namespace config block.
107
+ #
108
+ # Eg:
109
+ # config.namespace :without_comments do |without_comments|
110
+ # without_comments.allow_comments = false
111
+ # end
112
+
113
+
114
+ # == Batch Actions
115
+ #
116
+ # Enable and disable Batch Actions
117
+ #
118
+ config.batch_actions = true
119
+
120
+
121
+ # == Controller Filters
122
+ #
123
+ # You can add before, after and around filters to all of your
124
+ # Active Admin resources and pages from here.
125
+ #
126
+ # config.before_filter :do_something_awesome
127
+
128
+
129
+ # == Register Stylesheets & Javascripts
130
+ #
131
+ # We recommend using the built in Active Admin layout and loading
132
+ # up your own stylesheets / javascripts to customize the look
133
+ # and feel.
134
+ #
135
+ # To load a stylesheet:
136
+ # config.register_stylesheet 'my_stylesheet.css'
137
+
138
+ # You can provide an options hash for more control, which is passed along to stylesheet_link_tag():
139
+ # config.register_stylesheet 'my_print_stylesheet.css', :media => :print
140
+ #
141
+ # To load a javascript file:
142
+ # config.register_javascript 'my_javascript.js'
143
+
144
+
145
+ # == CSV options
146
+ #
147
+ # Set the CSV builder separator (default is ",")
148
+ # config.csv_column_separator = ','
149
+ #
150
+ # Set the CSV builder options (default is {})
151
+ # config.csv_options = {}
152
+
153
+
154
+ # == Menu System
155
+ #
156
+ # You can add a navigation menu to be used in your application, or configure a provided menu
157
+ #
158
+ # To change the default utility navigation to show a link to your website & a logout btn
159
+ #
160
+ # config.namespace :admin do |admin|
161
+ # admin.build_menu :utility_navigation do |menu|
162
+ # menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank }
163
+ # admin.add_logout_button_to_menu menu
164
+ # end
165
+ # end
166
+ #
167
+ # If you wanted to add a static menu item to the default menu provided:
168
+ #
169
+ # config.namespace :admin do |admin|
170
+ # admin.build_menu :default do |menu|
171
+ # menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank }
172
+ # end
173
+ # end
174
+
175
+ # == Download Links
176
+ #
177
+ # You can disable download links on resource listing pages,
178
+ # or customize the formats shown per namespace/globally
179
+ #
180
+ # To disable/customize for the :admin namespace:
181
+ #
182
+ # config.namespace :admin do |admin|
183
+ #
184
+ # # Disable the links entirely
185
+ # admin.download_links = false
186
+ #
187
+ # # Only show XML & PDF options
188
+ # admin.download_links = [:xml, :pdf]
189
+ #
190
+ # end
191
+
192
+
193
+ # == Pagination
194
+ #
195
+ # Pagination is enabled by default for all resources.
196
+ # You can control the default per page count for all resources here.
197
+ #
198
+ # config.default_per_page = 30
199
+
200
+
201
+ # == Filters
202
+ #
203
+ # By default the index screen includes a “Filters” sidebar on the right
204
+ # hand side with a filter for each attribute of the registered model.
205
+ # You can enable or disable them for all resources here.
206
+ #
207
+ # config.filters = true
208
+
209
+
210
+ end