devise_invitable 1.7.5 → 2.0.5

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

Potentially problematic release.


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

Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/README.rdoc +98 -111
  4. data/app/controllers/devise/invitations_controller.rb +41 -40
  5. data/app/controllers/devise_invitable/registrations_controller.rb +11 -11
  6. data/app/views/devise/invitations/edit.html.erb +14 -8
  7. data/app/views/devise/invitations/new.html.erb +11 -7
  8. data/app/views/devise/mailer/invitation_instructions.html.erb +1 -1
  9. data/app/views/devise/mailer/invitation_instructions.text.erb +1 -1
  10. data/config/locales/ar.yml +23 -0
  11. data/config/locales/da.yml +41 -0
  12. data/config/locales/de.yml +31 -0
  13. data/config/locales/es.yml +31 -0
  14. data/config/locales/et.yml +23 -0
  15. data/config/locales/fa.yml +31 -0
  16. data/config/locales/fr.yml +34 -0
  17. data/config/locales/it.yml +31 -0
  18. data/config/locales/ja.yml +31 -0
  19. data/config/locales/ko.yml +24 -0
  20. data/config/locales/nl.yml +32 -0
  21. data/config/locales/no.yml +17 -0
  22. data/config/locales/pl.yml +31 -0
  23. data/config/locales/pt-BR.yml +23 -0
  24. data/config/locales/pt.yml +23 -0
  25. data/config/locales/ru.yml +23 -0
  26. data/config/locales/tr.yml +24 -0
  27. data/config/locales/ua.yml +31 -0
  28. data/config/locales/vi.yml +25 -0
  29. data/config/locales/zh-HK.yml +31 -0
  30. data/config/locales/zh-TW.yml +31 -0
  31. data/lib/devise_invitable.rb +5 -4
  32. data/lib/devise_invitable/controllers/helpers.rb +3 -4
  33. data/lib/devise_invitable/inviter.rb +4 -3
  34. data/lib/devise_invitable/mailer.rb +1 -1
  35. data/lib/devise_invitable/mapping.rb +6 -5
  36. data/lib/devise_invitable/models.rb +29 -27
  37. data/lib/devise_invitable/models/authenticatable.rb +7 -1
  38. data/lib/devise_invitable/parameter_sanitizer.rb +18 -18
  39. data/lib/devise_invitable/routes.rb +5 -5
  40. data/lib/devise_invitable/version.rb +1 -1
  41. data/lib/generators/active_record/devise_invitable_generator.rb +3 -3
  42. data/lib/generators/active_record/templates/migration.rb +0 -1
  43. data/lib/generators/devise_invitable/devise_invitable_generator.rb +4 -8
  44. data/lib/generators/devise_invitable/install_generator.rb +11 -14
  45. data/lib/generators/devise_invitable/templates/simple_form_for/invitations/edit.html.erb +10 -6
  46. data/lib/generators/devise_invitable/templates/simple_form_for/invitations/new.html.erb +10 -6
  47. data/lib/generators/devise_invitable/views_generator.rb +6 -6
  48. data/test/functional/registrations_controller_test.rb +24 -25
  49. data/test/generators/views_generator_test.rb +7 -6
  50. data/test/generators_test.rb +3 -2
  51. data/test/integration/invitation_remove_test.rb +8 -8
  52. data/test/integration/invitation_test.rb +46 -46
  53. data/test/integration_tests_helper.rb +8 -9
  54. data/test/model_tests_helper.rb +5 -5
  55. data/test/models/invitable_test.rb +126 -110
  56. data/test/models_test.rb +3 -3
  57. data/test/orm/active_record.rb +2 -2
  58. data/test/orm/mongoid.rb +2 -2
  59. data/test/rails_app/app/controllers/admins_controller.rb +4 -3
  60. data/test/rails_app/app/controllers/application_controller.rb +11 -10
  61. data/test/rails_app/app/controllers/free_invitations_controller.rb +12 -9
  62. data/test/rails_app/app/controllers/users_controller.rb +2 -2
  63. data/test/rails_app/app/models/admin.rb +7 -10
  64. data/test/rails_app/app/models/octopussy.rb +4 -4
  65. data/test/rails_app/app/models/user.rb +20 -20
  66. data/test/rails_app/app/views/admins/new.html.erb +9 -5
  67. data/test/rails_app/app/views/devise/sessions/new.html.erb +14 -6
  68. data/test/rails_app/app/views/free_invitations/new.html.erb +9 -5
  69. data/test/rails_app/app/views/layouts/application.html.erb +3 -4
  70. data/test/rails_app/app/views/users/invitations/new.html.erb +15 -9
  71. data/test/rails_app/config/application.rb +6 -6
  72. data/test/rails_app/config/boot.rb +2 -2
  73. data/test/rails_app/config/credentials.yml.enc +1 -0
  74. data/test/rails_app/config/initializers/devise.rb +4 -3
  75. data/test/rails_app/config/initializers/secret_token.rb +3 -1
  76. data/test/rails_app/config/initializers/session_store.rb +1 -1
  77. data/test/rails_app/config/initializers/wrap_parameters.rb +1 -1
  78. data/test/rails_app/config/master.key +1 -0
  79. data/test/rails_app/config/routes.rb +3 -3
  80. data/test/rails_app/db/migrate/20100401102949_create_tables.rb +0 -2
  81. data/test/routes_test.rb +4 -4
  82. data/test/test_helper.rb +6 -19
  83. metadata +46 -22
data/test/models_test.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class Invitable < User
4
- devise :invitable, :invite_for => 5.days, :validate_on_invite => true
4
+ devise :invitable, invite_for: 5.days, validate_on_invite: true
5
5
  end
6
6
 
7
7
  class ModelsTest < ActiveSupport::TestCase
@@ -47,9 +47,9 @@ class ModelsTest < ActiveSupport::TestCase
47
47
 
48
48
  test 'set a custom value for invite_key' do
49
49
  old_invite_key = User.invite_key
50
- User.invite_key = {:username => /\A.+\z/}
50
+ User.invite_key = { username: /\A.+\z/}
51
51
 
52
- assert_equal({:username => /\A.+\z/}, User.invite_key)
52
+ assert_equal({ username: /\A.+\z/ }, User.invite_key)
53
53
 
54
54
  User.invite_key = old_invite_key
55
55
  end
@@ -2,7 +2,7 @@ ActiveRecord::Migration.verbose = false
2
2
  ActiveRecord::Base.logger = Logger.new(nil)
3
3
 
4
4
  if defined? ActiveRecord::MigrationContext # rails >= 5.2
5
- ActiveRecord::MigrationContext.new(File.expand_path("../../rails_app/db/migrate/", __FILE__)).migrate
5
+ ActiveRecord::MigrationContext.new(File.expand_path('../../rails_app/db/migrate/', __FILE__)).migrate
6
6
  else
7
- ActiveRecord::Migrator.migrate(File.expand_path("../../rails_app/db/migrate/", __FILE__))
7
+ ActiveRecord::Migrator.migrate(File.expand_path('../../rails_app/db/migrate/', __FILE__))
8
8
  end
data/test/orm/mongoid.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  Mongoid.configure do |config|
2
2
  if Mongoid::VERSION < '3.0.0'
3
- config.master = Mongo::Connection.new('127.0.0.1', 27017).db("devise_invitable-test-suite")
3
+ config.master = Mongo::Connection.new('127.0.0.1', 27017).db('devise_invitable-test-suite')
4
4
  else
5
- config.connect_to("devise_invitable-test-suite")
5
+ config.connect_to('devise_invitable-test-suite')
6
6
  config.use_utc = true
7
7
  config.include_root_in_json = true
8
8
  end
@@ -1,6 +1,7 @@
1
1
  class AdminsController < Devise::InvitationsController
2
2
  protected
3
- def authenticate_inviter!
4
- authenticate_admin!(:force => true)
5
- end
3
+
4
+ def authenticate_inviter!
5
+ authenticate_admin!(force: true)
6
+ end
6
7
  end
@@ -1,17 +1,18 @@
1
1
  class ApplicationController < ActionController::Base
2
2
  protect_from_forgery
3
- before_action :configure_permitted_parameters, :if => :devise_controller?
3
+ before_action :configure_permitted_parameters, if: :devise_controller?
4
4
 
5
5
  protected
6
- def after_sign_in_path_for(resource)
7
- if resource.is_a? Admin
8
- edit_admin_registration_path(resource)
9
- else
10
- super
6
+
7
+ def after_sign_in_path_for(resource)
8
+ if resource.is_a? Admin
9
+ edit_admin_registration_path(resource)
10
+ else
11
+ super
12
+ end
11
13
  end
12
- end
13
14
 
14
- def configure_permitted_parameters
15
- devise_parameter_sanitizer.permit(:sign_up, keys: [:email, :password, :bio])
16
- end
15
+ def configure_permitted_parameters
16
+ devise_parameter_sanitizer.permit(:sign_up, keys: [:email, :password, :bio])
17
+ end
17
18
  end
@@ -1,12 +1,15 @@
1
1
  class FreeInvitationsController < Devise::InvitationsController
2
2
  protected
3
- def authenticate_inviter!
4
- # everyone can invite
5
- end
6
- def current_inviter
7
- current_admin || current_user
8
- end
9
- def after_invite_path_for(resource)
10
- resource ? super : root_path
11
- end
3
+
4
+ def authenticate_inviter!
5
+ # everyone can invite
6
+ end
7
+
8
+ def current_inviter
9
+ current_admin || current_user
10
+ end
11
+
12
+ def after_invite_path_for(resource)
13
+ resource ? super : root_path
14
+ end
12
15
  end
@@ -2,11 +2,11 @@ class UsersController < ApplicationController
2
2
  before_action :authenticate_user!
3
3
 
4
4
  def index
5
- user_session[:cart] = "Cart"
5
+ user_session[:cart] = 'Cart'
6
6
  end
7
7
 
8
8
  def expire
9
9
  user_session['last_request_at'] = 31.minutes.ago.utc
10
- render :text => 'User will be expired on next request'
10
+ render text: 'User will be expired on next request'
11
11
  end
12
12
  end
@@ -3,21 +3,18 @@ class Admin < PARENT_MODEL_CLASS
3
3
  include Mongoid::Document
4
4
  include Mongoid::Attributes::Dynamic if defined?(Mongoid::Attributes::Dynamic)
5
5
  ## Database authenticatable
6
- field :email, :type => String, :default => ""
7
- field :encrypted_password, :type => String, :default => ""
6
+ field :email, type: String, default: ""
7
+ field :encrypted_password, type: String, default: ""
8
8
  validates_presence_of :email
9
- validates_presence_of :encrypted_password, :if => :password_required?
9
+ validates_presence_of :encrypted_password, if: :password_required?
10
10
 
11
11
  ## Confirmable
12
- field :confirmation_token, :type => String
13
- field :confirmed_at, :type => Time
14
- field :confirmation_sent_at, :type => Time
15
- field :unconfirmed_email, :type => String # Only if using reconfirmable
16
-
12
+ field :confirmation_token, type: String
13
+ field :confirmed_at, type: Time
14
+ field :confirmation_sent_at, type: Time
15
+ field :unconfirmed_email, type: String # Only if using reconfirmable
17
16
  end
18
17
 
19
-
20
-
21
18
  devise :database_authenticatable, :validatable, :registerable
22
19
  include DeviseInvitable::Inviter
23
20
  end
@@ -5,11 +5,11 @@ class Octopussy < PARENT_MODEL_CLASS
5
5
  include Mongoid::Attributes::Dynamic if defined?(Mongoid::Attributes::Dynamic)
6
6
 
7
7
  ## Database authenticatable
8
- field :email, :type => String, :default => ""
9
- field :encrypted_password, :type => String, :default => ""
8
+ field :email, type: String, default: ""
9
+ field :encrypted_password, type: String, default: ""
10
10
  validates_presence_of :email
11
- validates_presence_of :encrypted_password, :if => :password_required?
12
-
11
+ validates_presence_of :encrypted_password, if: :password_required?
13
12
  end
13
+
14
14
  devise :database_authenticatable, :validatable, :confirmable
15
15
  end
@@ -4,45 +4,45 @@ class User < PARENT_MODEL_CLASS
4
4
  include Mongoid::Attributes::Dynamic if defined?(Mongoid::Attributes::Dynamic)
5
5
 
6
6
  ## Database authenticatable
7
- field :email, :type => String, :default => ""
8
- field :encrypted_password, :type => String, :default => ""
7
+ field :email, type: String, default: ""
8
+ field :encrypted_password, type: String, default: ""
9
9
 
10
10
  ## Recoverable
11
- field :reset_password_token, :type => String
12
- field :reset_password_sent_at, :type => Time
11
+ field :reset_password_token, type: String
12
+ field :reset_password_sent_at, type: Time
13
13
 
14
14
  ## Confirmable
15
- field :confirmation_token, :type => String
16
- field :confirmed_at, :type => Time
17
- field :confirmation_sent_at, :type => Time
18
- field :unconfirmed_email, :type => String # Only if using reconfirmable
15
+ field :confirmation_token, type: String
16
+ field :confirmed_at, type: Time
17
+ field :confirmation_sent_at, type: Time
18
+ field :unconfirmed_email, type: String # Only if using reconfirmable
19
19
 
20
20
  ## Invitable
21
- field :invitation_token, :type => String
22
- field :invitation_created_at, :type => Time
23
- field :invitation_sent_at, :type => Time
24
- field :invitation_accepted_at, :type => Time
25
- field :invitation_limit, :type => Integer
26
- field :invited_by_id, :type => Integer
27
- field :invited_by_type, :type => String
21
+ field :invitation_token, type: String
22
+ field :invitation_created_at, type: Time
23
+ field :invitation_sent_at, type: Time
24
+ field :invitation_accepted_at, type: Time
25
+ field :invitation_limit, type: Integer
26
+ field :invited_by_id, type: Integer
27
+ field :invited_by_type, type: String
28
28
 
29
29
  field :username
30
30
  field :profile_id
31
31
  field :active
32
32
 
33
33
  validates_presence_of :email
34
- validates_presence_of :encrypted_password, :if => :password_required?
34
+ validates_presence_of :encrypted_password, if: :password_required?
35
35
  end
36
36
 
37
37
  devise :database_authenticatable, :registerable, :validatable, :confirmable, :invitable, :recoverable
38
38
 
39
39
  attr_accessor :after_invitation_created_callback_works, :after_invitation_accepted_callback_works, :bio, :token
40
- validates :username, :length => { :maximum => 20 }
40
+ validates :username, length: { maximum: 20 }
41
41
 
42
42
  attr_accessor :testing_accepted_or_not_invited
43
43
 
44
- validates :username, :presence => true, :if => :testing_accepted_or_not_invited_validator?
45
- validates :bio, :presence => true, :if => :invitation_accepted?
44
+ validates :username, presence: true, if: :testing_accepted_or_not_invited_validator?
45
+ validates :bio, presence: true, if: :invitation_accepted?
46
46
 
47
47
  def testing_accepted_or_not_invited_validator?
48
48
  testing_accepted_or_not_invited && accepted_or_not_invited?
@@ -56,7 +56,7 @@ class User < PARENT_MODEL_CLASS
56
56
  object.after_invitation_accepted_callback_works = true
57
57
  end
58
58
 
59
- def send_devise_notification(method, raw=nil, *args)
59
+ def send_devise_notification(method, raw = nil, *args)
60
60
  Thread.current[:token] = raw
61
61
  super
62
62
  end
@@ -1,12 +1,16 @@
1
1
  <h2>Send invitation</h2>
2
2
 
3
- <%= form_for resource, :as => resource_name, :url => admin_path do |f| %>
4
- <%= devise_error_messages! %>
3
+ <%= form_for(resource, as: resource_name, url: admin_path) do |f| %>
4
+ <%= render "devise/shared/error_messages", resource: resource %>
5
5
 
6
- <p><%= f.label :email %><br />
7
- <%= f.text_field :email %></p>
6
+ <div class="field">
7
+ <%= f.label :email %><br />
8
+ <%= f.text_field :email %>
9
+ </div>
8
10
 
9
- <p><%= f.submit "Send an invitation" %></p>
11
+ <div class="actions">
12
+ <%= f.submit "Send an invitation" %>
13
+ </div>
10
14
  <% end %>
11
15
 
12
16
  <%= link_to "Home", after_sign_in_path_for(resource_name) %><br />
@@ -1,17 +1,25 @@
1
1
  <h2>Log in</h2>
2
2
 
3
3
  <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
4
- <div><%= f.label :email %><br />
5
- <%= f.email_field :email, autofocus: true %></div>
4
+ <div class="field">
5
+ <%= f.label :email %><br />
6
+ <%= f.email_field :email, autofocus: true %>
7
+ </div>
6
8
 
7
- <div><%= f.label :password %><br />
8
- <%= f.password_field :password, autocomplete: "off" %></div>
9
+ <div class="field">
10
+ <%= f.label :password %><br />
11
+ <%= f.password_field :password, autocomplete: "off" %>
12
+ </div>
9
13
 
10
14
  <% if devise_mapping.rememberable? -%>
11
- <div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
15
+ <div class="field">
16
+ <%= f.check_box :remember_me %> <%= f.label :remember_me %>
17
+ </div>
12
18
  <% end -%>
13
19
 
14
- <div><%= f.submit "Log in" %></div>
20
+ <div class="actions">
21
+ <%= f.submit "Log in" %>
22
+ </div>
15
23
  <% end %>
16
24
 
17
25
  <%= render "devise/shared/links" %>
@@ -1,12 +1,16 @@
1
1
  <h2>Send invitation</h2>
2
2
 
3
- <%= form_for resource, :as => resource_name, :url => free_invitation_path do |f| %>
4
- <%= devise_error_messages! %>
3
+ <%= form_for(resource, as: resource_name, url: free_invitation_path) do |f| %>
4
+ <%= render "devise/shared/error_messages", resource: resource %>
5
5
 
6
- <p><%= f.label :email %><br />
7
- <%= f.text_field :email %></p>
6
+ <div class="field">
7
+ <%= f.label :email %><br />
8
+ <%= f.text_field :email %>
9
+ </div>
8
10
 
9
- <p><%= f.submit "Send an invitation" %></p>
11
+ <div class="actions">
12
+ <%= f.submit "Send an invitation" %>
13
+ </div>
10
14
  <% end %>
11
15
 
12
16
  <%= link_to "Home", after_sign_in_path_for(resource_name) %><br />
@@ -7,10 +7,9 @@
7
7
  <%= csrf_meta_tag %>
8
8
  </head>
9
9
  <body>
10
+ <%= content_tag :p, flash[:notice], id: 'notice' unless flash[:notice].blank? %>
11
+ <%= content_tag :p, flash[:alert], id: 'alert' unless flash[:alert].blank? %>
10
12
 
11
- <%= content_tag :p, flash[:notice], :id => 'notice' unless flash[:notice].blank? %>
12
- <%= content_tag :p, flash[:alert], :id => 'alert' unless flash[:alert].blank? %>
13
- <%= yield %>
14
-
13
+ <%= yield %>
15
14
  </body>
16
15
  </html>
@@ -1,15 +1,21 @@
1
1
  <h2>Send an invitation</h2>
2
2
 
3
- <%= form_for resource, :as => resource_name, :url => invitation_path(resource_name), :html => { :method => :post } do |f| %>
4
- <%= devise_error_messages! %>
3
+ <%= form_for(resource, as: resource_name, url: invitation_path(resource_name), html: { method: :post }) do |f| %>
4
+ <%= render "devise/shared/error_messages", resource: resource %>
5
5
 
6
- <p><%= f.label :username %></p>
7
- <p><%= f.text_field :username %></p>
8
-
9
- <p><%= f.label :email %></p>
10
- <p><%= f.text_field :email %></p>
11
-
12
- <p><%= f.submit "Send an invitation" %></p>
6
+ <div class="field">
7
+ <%= f.label :username %>
8
+ <%= f.text_field :username %>
9
+ </div>
10
+
11
+ <div class="field">
12
+ <%= f.label :email %>
13
+ <%= f.text_field :email %>
14
+ </div>
15
+
16
+ <div class="actions">
17
+ <%= f.submit "Send an invitation" %>
18
+ </div>
13
19
  <% end %>
14
20
 
15
21
  <%= link_to "Home", after_sign_in_path_for(resource_name) %><br />
@@ -1,8 +1,8 @@
1
1
  require File.expand_path('../boot', __FILE__)
2
2
 
3
- require "action_controller/railtie"
4
- require "action_mailer/railtie"
5
- require "rails/test_unit/railtie"
3
+ require 'action_controller/railtie'
4
+ require 'action_mailer/railtie'
5
+ require 'rails/test_unit/railtie'
6
6
 
7
7
  Bundler.require(:default, DEVISE_ORM) if defined?(Bundler)
8
8
 
@@ -14,13 +14,13 @@ end
14
14
  PARENT_MODEL_CLASS = DEVISE_ORM == :active_record ? ActiveRecord::Base : Object
15
15
  Mongoid.load!(File.expand_path('../../mongoid.yml', __FILE__)) if DEVISE_ORM == :mongoid && Mongoid::VERSION < '3.0.0'
16
16
 
17
- require "devise"
18
- require "devise_invitable"
17
+ require 'devise'
18
+ require 'devise_invitable'
19
19
 
20
20
  module RailsApp
21
21
  class Application < Rails::Application
22
22
  config.filter_parameters << :password
23
- config.action_mailer.default_url_options = { :host => "localhost:3000" }
23
+ config.action_mailer.default_url_options = { host: 'localhost:3000' }
24
24
  if DEVISE_ORM == :active_record && Rails.version.start_with?('5')
25
25
  config.active_record.maintain_test_schema = false
26
26
  config.active_record.sqlite3.represent_boolean_as_integer = true if config.active_record.sqlite3
@@ -1,9 +1,9 @@
1
1
  unless defined?(DEVISE_ORM)
2
- DEVISE_ORM = (ENV["DEVISE_ORM"] || :active_record).to_sym
2
+ DEVISE_ORM = (ENV['DEVISE_ORM'] || :active_record).to_sym
3
3
  end
4
4
 
5
5
  begin
6
- require File.expand_path("../../../../.bundle/environment", __FILE__)
6
+ require File.expand_path('../../../../.bundle/environment', __FILE__)
7
7
  rescue LoadError
8
8
  require 'rubygems'
9
9
  require 'bundler'
@@ -0,0 +1 @@
1
+ d19hQaf4kv/ajU/ABKNej/dqmAPNDfiZSBnGbsfBAs3oLxNVvuJm8TJ1bUMaZ2s2hcDSZRQKHtJqcDfBMrN0egkVPYaoGvYOZ7XzU2v9O1xhEwI9wFO+0yWDDTDxC8UJr60s+Gh++jQMCxTZ+Yhl5Od8d2rqoMcuhZrGhKOuvPBARyyDSN2/Q0rvIYO+OGFFkwTK+HD2ccRzYWBNH8DBMSeh8ja83BykLE0fNL9tPmYKK1gnEsME7AN8UN/AmFqFPLOX9otfQ0imwLhnsWMYPxqfJoqvgEpuAywPW3n3nIpzX1/dwpDrHnm5tbsIwgctlq4Q2DFu6dc7H3Pzjx6INWCB5pr97zH84+gHjYuoLafUxGEN8zbxFyrPe0Pm8jPi5qfJP3HlaweFR/XhNI1s+pl2WZQqAEkjMp0h--z4CX57AIHm+gPVBc--UBpBryKnypoqwmbLDIqa8Q==
@@ -91,8 +91,8 @@ Devise.setup do |config|
91
91
  # config.pepper = "e31589192aeea8807cb7d8686b0f8484d6cbfaaa65443d45144519ed1d4ffbc6ccb73b21a69ece276d94f2cac95d83990d824f36f301d6f585ededd1bf90d67d"
92
92
 
93
93
  # ==> Configuration for :invitable
94
- # The period the generated invitation token is valid, after
95
- # this period, the invited resource won't be able to accept the invitation.
94
+ # The period the generated invitation token is valid.
95
+ # After this period, the invited resource won't be able to accept the invitation.
96
96
  # When invite_for is 0 (the default), the invitation won't expire.
97
97
  # config.invite_for = 2.weeks
98
98
 
@@ -111,7 +111,8 @@ Devise.setup do |config|
111
111
  # config.invite_key = {:email => /\\A[^@]+@[^@]+\\z/}
112
112
  # config.invite_key = {:email => /\\A[^@]+@[^@]+\\z/, :username => nil}
113
113
 
114
- # Flag that force a record to be valid before being actually invited
114
+ # Ensure that invited record is valid.
115
+ # The invitation won't be sent if this check fails.
115
116
  # Default: false
116
117
  # config.validate_on_invite = true
117
118
 
@@ -4,4 +4,6 @@
4
4
  # If you change this key, all old signed cookies will become invalid!
5
5
  # Make sure the secret is at least 30 characters and all random,
6
6
  # no regular words or you'll be exposed to dictionary attacks.
7
- RailsApp::Application.config.secret_token = 'e997edf9d7eba5cf89a76a046fa53f5d66261d22cfcf29e3f538c75ad2d175b106bd5d099f44f6ce34ad3b3162d71cfaa37d2d4f4b38645288331427b4c2a607'
7
+ if Rails.version < '5.2.0'
8
+ RailsApp::Application.config.secret_token = 'e997edf9d7eba5cf89a76a046fa53f5d66261d22cfcf29e3f538c75ad2d175b106bd5d099f44f6ce34ad3b3162d71cfaa37d2d4f4b38645288331427b4c2a607'
9
+ end