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
+ ActiveI18n.config(
2
+ store: I18n::Backend::KeyValue.new({})
3
+ )
@@ -0,0 +1,7 @@
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!
@@ -0,0 +1,256 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth.
2
+ # Many of these configuration options can be set straight in your model.
3
+ Devise.setup do |config|
4
+ # The secret key used by Devise. Devise uses this key to generate
5
+ # random tokens. Changing this key will render invalid all existing
6
+ # confirmation, reset password and unlock tokens in the database.
7
+ config.secret_key = 'c2b6e7d10d913916ec75afa9bcb4807a8b70b05e7d054baeb30c9147f33bc1d218f7b6151f2995de3b69400d1ae58e0d75a36200e3f35a0fdb046e4bf35fcae9'
8
+
9
+ # ==> Mailer Configuration
10
+ # Configure the e-mail address which will be shown in Devise::Mailer,
11
+ # note that it will be overwritten if you use your own mailer class
12
+ # with default "from" parameter.
13
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
14
+
15
+ # Configure the class responsible to send e-mails.
16
+ # config.mailer = 'Devise::Mailer'
17
+
18
+ # ==> ORM configuration
19
+ # Load and configure the ORM. Supports :active_record (default) and
20
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
21
+ # available as additional gems.
22
+ require 'devise/orm/active_record'
23
+
24
+ # ==> Configuration for any authentication mechanism
25
+ # Configure which keys are used when authenticating a user. The default is
26
+ # just :email. You can configure it to use [:username, :subdomain], so for
27
+ # authenticating a user, both parameters are required. Remember that those
28
+ # parameters are used only when authenticating and not when retrieving from
29
+ # session. If you need permissions, you should implement that in a before filter.
30
+ # You can also supply a hash where the value is a boolean determining whether
31
+ # or not authentication should be aborted when the value is not present.
32
+ # config.authentication_keys = [ :email ]
33
+
34
+ # Configure parameters from the request object used for authentication. Each entry
35
+ # given should be a request method and it will automatically be passed to the
36
+ # find_for_authentication method and considered in your model lookup. For instance,
37
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
38
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
39
+ # config.request_keys = []
40
+
41
+ # Configure which authentication keys should be case-insensitive.
42
+ # These keys will be downcased upon creating or modifying a user and when used
43
+ # to authenticate or find a user. Default is :email.
44
+ config.case_insensitive_keys = [ :email ]
45
+
46
+ # Configure which authentication keys should have whitespace stripped.
47
+ # These keys will have whitespace before and after removed upon creating or
48
+ # modifying a user and when used to authenticate or find a user. Default is :email.
49
+ config.strip_whitespace_keys = [ :email ]
50
+
51
+ # Tell if authentication through request.params is enabled. True by default.
52
+ # It can be set to an array that will enable params authentication only for the
53
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
54
+ # enable it only for database (email + password) authentication.
55
+ # config.params_authenticatable = true
56
+
57
+ # Tell if authentication through HTTP Auth is enabled. False by default.
58
+ # It can be set to an array that will enable http authentication only for the
59
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
60
+ # enable it only for database authentication. The supported strategies are:
61
+ # :database = Support basic authentication with authentication key + password
62
+ # config.http_authenticatable = false
63
+
64
+ # If http headers should be returned for AJAX requests. True by default.
65
+ # config.http_authenticatable_on_xhr = true
66
+
67
+ # The realm used in Http Basic Authentication. 'Application' by default.
68
+ # config.http_authentication_realm = 'Application'
69
+
70
+ # It will change confirmation, password recovery and other workflows
71
+ # to behave the same regardless if the e-mail provided was right or wrong.
72
+ # Does not affect registerable.
73
+ # config.paranoid = true
74
+
75
+ # By default Devise will store the user in session. You can skip storage for
76
+ # particular strategies by setting this option.
77
+ # Notice that if you are skipping storage for all authentication paths, you
78
+ # may want to disable generating routes to Devise's sessions controller by
79
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
80
+ config.skip_session_storage = [:http_auth]
81
+
82
+ # By default, Devise cleans up the CSRF token on authentication to
83
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
84
+ # requests for sign in and sign up, you need to get a new CSRF token
85
+ # from the server. You can disable this option at your own risk.
86
+ # config.clean_up_csrf_token_on_authentication = true
87
+
88
+ # ==> Configuration for :database_authenticatable
89
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
90
+ # using other encryptors, it sets how many times you want the password re-encrypted.
91
+ #
92
+ # Limiting the stretches to just one in testing will increase the performance of
93
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
94
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
95
+ # encryptor), the cost increases exponentially with the number of stretches (e.g.
96
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
97
+ config.stretches = Rails.env.test? ? 1 : 10
98
+
99
+ # Setup a pepper to generate the encrypted password.
100
+ # config.pepper = '047325cb7afc47dedb65d5cf158373494711f43d7c341671deda8a09877e2bc5e9c1af8070c09e1232229f131c21f9f7495baaa287a7a8d3cd740860980ede4a'
101
+
102
+ # ==> Configuration for :confirmable
103
+ # A period that the user is allowed to access the website even without
104
+ # confirming their account. For instance, if set to 2.days, the user will be
105
+ # able to access the website for two days without confirming their account,
106
+ # access will be blocked just in the third day. Default is 0.days, meaning
107
+ # the user cannot access the website without confirming their account.
108
+ # config.allow_unconfirmed_access_for = 2.days
109
+
110
+ # A period that the user is allowed to confirm their account before their
111
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
112
+ # their account within 3 days after the mail was sent, but on the fourth day
113
+ # their account can't be confirmed with the token any more.
114
+ # Default is nil, meaning there is no restriction on how long a user can take
115
+ # before confirming their account.
116
+ # config.confirm_within = 3.days
117
+
118
+ # If true, requires any email changes to be confirmed (exactly the same way as
119
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
120
+ # db field (see migrations). Until confirmed, new email is stored in
121
+ # unconfirmed_email column, and copied to email column on successful confirmation.
122
+ config.reconfirmable = true
123
+
124
+ # Defines which key will be used when confirming an account
125
+ # config.confirmation_keys = [ :email ]
126
+
127
+ # ==> Configuration for :rememberable
128
+ # The time the user will be remembered without asking for credentials again.
129
+ # config.remember_for = 2.weeks
130
+
131
+ # If true, extends the user's remember period when remembered via cookie.
132
+ # config.extend_remember_period = false
133
+
134
+ # Options to be passed to the created cookie. For instance, you can set
135
+ # secure: true in order to force SSL only cookies.
136
+ # config.rememberable_options = {}
137
+
138
+ # ==> Configuration for :validatable
139
+ # Range for password length.
140
+ config.password_length = 8..128
141
+
142
+ # Email regex used to validate email formats. It simply asserts that
143
+ # one (and only one) @ exists in the given string. This is mainly
144
+ # to give user feedback and not to assert the e-mail validity.
145
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
146
+
147
+ # ==> Configuration for :timeoutable
148
+ # The time you want to timeout the user session without activity. After this
149
+ # time the user will be asked for credentials again. Default is 30 minutes.
150
+ # config.timeout_in = 30.minutes
151
+
152
+ # If true, expires auth token on session timeout.
153
+ # config.expire_auth_token_on_timeout = false
154
+
155
+ # ==> Configuration for :lockable
156
+ # Defines which strategy will be used to lock an account.
157
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
158
+ # :none = No lock strategy. You should handle locking by yourself.
159
+ # config.lock_strategy = :failed_attempts
160
+
161
+ # Defines which key will be used when locking and unlocking an account
162
+ # config.unlock_keys = [ :email ]
163
+
164
+ # Defines which strategy will be used to unlock an account.
165
+ # :email = Sends an unlock link to the user email
166
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
167
+ # :both = Enables both strategies
168
+ # :none = No unlock strategy. You should handle unlocking by yourself.
169
+ # config.unlock_strategy = :both
170
+
171
+ # Number of authentication tries before locking an account if lock_strategy
172
+ # is failed attempts.
173
+ # config.maximum_attempts = 20
174
+
175
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
176
+ # config.unlock_in = 1.hour
177
+
178
+ # Warn on the last attempt before the account is locked.
179
+ # config.last_attempt_warning = false
180
+
181
+ # ==> Configuration for :recoverable
182
+ #
183
+ # Defines which key will be used when recovering the password for an account
184
+ # config.reset_password_keys = [ :email ]
185
+
186
+ # Time interval you can reset your password with a reset password key.
187
+ # Don't put a too small interval or your users won't have the time to
188
+ # change their passwords.
189
+ config.reset_password_within = 6.hours
190
+
191
+ # ==> Configuration for :encryptable
192
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
193
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
194
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
195
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
196
+ # REST_AUTH_SITE_KEY to pepper).
197
+ #
198
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
199
+ # config.encryptor = :sha512
200
+
201
+ # ==> Scopes configuration
202
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
203
+ # "users/sessions/new". It's turned off by default because it's slower if you
204
+ # are using only default views.
205
+ # config.scoped_views = false
206
+
207
+ # Configure the default scope given to Warden. By default it's the first
208
+ # devise role declared in your routes (usually :user).
209
+ # config.default_scope = :user
210
+
211
+ # Set this configuration to false if you want /users/sign_out to sign out
212
+ # only the current scope. By default, Devise signs out all scopes.
213
+ # config.sign_out_all_scopes = true
214
+
215
+ # ==> Navigation configuration
216
+ # Lists the formats that should be treated as navigational. Formats like
217
+ # :html, should redirect to the sign in page when the user does not have
218
+ # access, but formats like :xml or :json, should return 401.
219
+ #
220
+ # If you have any extra navigational formats, like :iphone or :mobile, you
221
+ # should add them to the navigational formats lists.
222
+ #
223
+ # The "*/*" below is required to match Internet Explorer requests.
224
+ # config.navigational_formats = ['*/*', :html]
225
+
226
+ # The default HTTP method used to sign out a resource. Default is :delete.
227
+ config.sign_out_via = :delete
228
+
229
+ # ==> OmniAuth
230
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
231
+ # up on your models and hooks.
232
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
233
+
234
+ # ==> Warden configuration
235
+ # If you want to use other strategies, that are not supported by Devise, or
236
+ # change the failure app, you can configure them inside the config.warden block.
237
+ #
238
+ # config.warden do |manager|
239
+ # manager.intercept_401 = false
240
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
241
+ # end
242
+
243
+ # ==> Mountable engine configurations
244
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
245
+ # is mountable, there are some extra configurations to be taken into account.
246
+ # The following options are available, assuming the engine is mounted as:
247
+ #
248
+ # mount MyEngine, at: '/my_engine'
249
+ #
250
+ # The router that invoked `devise_for`, in the example above, would be:
251
+ # config.router_name = :my_engine
252
+ #
253
+ # When using omniauth, Devise cannot automatically set Omniauth path,
254
+ # so you need to do it manually. For the users scope, it would be:
255
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
256
+ end
@@ -0,0 +1,15 @@
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
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
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
@@ -0,0 +1,7 @@
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 = '475a44c871fece89e479d1091caf090128abce50ada7059a395889c9be9d52058d195663a73f9209249ac657ba632895a894059cf9ee942302b9b12349be8906'
@@ -0,0 +1,8 @@
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
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,59 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ devise:
5
+ confirmations:
6
+ confirmed: "Your account was successfully confirmed."
7
+ send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
8
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
9
+ failure:
10
+ already_authenticated: "You are already signed in."
11
+ inactive: "Your account is not activated yet."
12
+ invalid: "Invalid email or password."
13
+ locked: "Your account is locked."
14
+ last_attempt: "You have one more attempt before your account will be locked."
15
+ not_found_in_database: "Invalid email or password."
16
+ timeout: "Your session expired. Please sign in again to continue."
17
+ unauthenticated: "You need to sign in or sign up before continuing."
18
+ unconfirmed: "You have to confirm your account before continuing."
19
+ mailer:
20
+ confirmation_instructions:
21
+ subject: "Confirmation instructions"
22
+ reset_password_instructions:
23
+ subject: "Reset password instructions"
24
+ unlock_instructions:
25
+ subject: "Unlock Instructions"
26
+ omniauth_callbacks:
27
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
28
+ success: "Successfully authenticated from %{kind} account."
29
+ passwords:
30
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
31
+ send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
32
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
33
+ updated: "Your password was changed successfully. You are now signed in."
34
+ updated_not_active: "Your password was changed successfully."
35
+ registrations:
36
+ destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon."
37
+ signed_up: "Welcome! You have signed up successfully."
38
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
39
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
40
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account."
41
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
42
+ updated: "You updated your account successfully."
43
+ sessions:
44
+ signed_in: "Signed in successfully."
45
+ signed_out: "Signed out successfully."
46
+ unlocks:
47
+ send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes."
48
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes."
49
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
50
+ errors:
51
+ messages:
52
+ already_confirmed: "was already confirmed, please try signing in"
53
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
54
+ expired: "has expired, please request a new one"
55
+ not_found: "not found"
56
+ not_locked: "was not locked"
57
+ not_saved:
58
+ one: "1 error prohibited this %{resource} from being saved:"
59
+ other: "%{count} errors prohibited this %{resource} from being saved:"
@@ -0,0 +1,5 @@
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"
@@ -0,0 +1,7 @@
1
+ en:
2
+ nested_test:
3
+ nested1: a
4
+ nested2: b
5
+ test:
6
+ first_key: First key
7
+ second_key: Second key
@@ -0,0 +1,5 @@
1
+ pl:
2
+ test:
3
+ first_key: Pierwszy klucz
4
+ second_key: Drugi klucz
5
+ third_key: Trzeci klucz
@@ -0,0 +1,7 @@
1
+ Rails.application.routes.draw do
2
+
3
+ devise_for :admin_users, ActiveAdmin::Devise.config
4
+ ActiveAdmin.routes(self)
5
+
6
+ mount ActiveI18n::Engine => "/active_i18n"
7
+ end
@@ -0,0 +1,48 @@
1
+ class DeviseCreateAdminUsers < ActiveRecord::Migration
2
+ def migrate(direction)
3
+ super
4
+ # Create a default user
5
+ AdminUser.create!(:email => 'admin@example.com', :password => 'password', :password_confirmation => 'password') if direction == :up
6
+ end
7
+
8
+ def change
9
+ create_table(:admin_users) do |t|
10
+ ## Database authenticatable
11
+ t.string :email, null: false, default: ""
12
+ t.string :encrypted_password, null: false, default: ""
13
+
14
+ ## Recoverable
15
+ t.string :reset_password_token
16
+ t.datetime :reset_password_sent_at
17
+
18
+ ## Rememberable
19
+ t.datetime :remember_created_at
20
+
21
+ ## Trackable
22
+ t.integer :sign_in_count, default: 0, null: false
23
+ t.datetime :current_sign_in_at
24
+ t.datetime :last_sign_in_at
25
+ t.string :current_sign_in_ip
26
+ t.string :last_sign_in_ip
27
+
28
+ ## Confirmable
29
+ # t.string :confirmation_token
30
+ # t.datetime :confirmed_at
31
+ # t.datetime :confirmation_sent_at
32
+ # t.string :unconfirmed_email # Only if using reconfirmable
33
+
34
+ ## Lockable
35
+ # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
36
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
37
+ # t.datetime :locked_at
38
+
39
+
40
+ t.timestamps
41
+ end
42
+
43
+ add_index :admin_users, :email, unique: true
44
+ add_index :admin_users, :reset_password_token, unique: true
45
+ # add_index :admin_users, :confirmation_token, unique: true
46
+ # add_index :admin_users, :unlock_token, unique: true
47
+ end
48
+ end