devise-multi_email 1.0.5 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -1
  3. data/CHANGELOG.md +15 -2
  4. data/Gemfile +2 -9
  5. data/README.md +69 -18
  6. data/devise-multi_email.gemspec +4 -0
  7. data/examples/rails5_app/.gitignore +21 -0
  8. data/examples/rails5_app/Gemfile +55 -0
  9. data/examples/rails5_app/Gemfile.lock +185 -0
  10. data/examples/rails5_app/README.md +24 -0
  11. data/examples/rails5_app/Rakefile +6 -0
  12. data/examples/rails5_app/app/assets/config/manifest.js +3 -0
  13. data/examples/rails5_app/app/assets/images/.keep +0 -0
  14. data/examples/rails5_app/app/assets/javascripts/application.js +16 -0
  15. data/examples/rails5_app/app/assets/javascripts/cable.js +13 -0
  16. data/examples/rails5_app/app/assets/javascripts/channels/.keep +0 -0
  17. data/examples/rails5_app/app/assets/stylesheets/application.css +15 -0
  18. data/examples/rails5_app/app/channels/application_cable/channel.rb +4 -0
  19. data/examples/rails5_app/app/channels/application_cable/connection.rb +4 -0
  20. data/examples/rails5_app/app/controllers/application_controller.rb +3 -0
  21. data/examples/rails5_app/app/controllers/concerns/.keep +0 -0
  22. data/examples/rails5_app/app/helpers/application_helper.rb +2 -0
  23. data/examples/rails5_app/app/jobs/application_job.rb +2 -0
  24. data/examples/rails5_app/app/mailers/application_mailer.rb +4 -0
  25. data/examples/rails5_app/app/models/application_record.rb +3 -0
  26. data/examples/rails5_app/app/models/concerns/.keep +0 -0
  27. data/examples/rails5_app/app/models/email.rb +3 -0
  28. data/examples/rails5_app/app/models/user.rb +9 -0
  29. data/examples/rails5_app/app/views/layouts/application.html.erb +14 -0
  30. data/examples/rails5_app/app/views/layouts/mailer.html.erb +13 -0
  31. data/examples/rails5_app/app/views/layouts/mailer.text.erb +1 -0
  32. data/examples/rails5_app/bin/bundle +3 -0
  33. data/examples/rails5_app/bin/rails +4 -0
  34. data/examples/rails5_app/bin/rake +4 -0
  35. data/examples/rails5_app/bin/setup +34 -0
  36. data/examples/rails5_app/bin/update +29 -0
  37. data/examples/rails5_app/config/application.rb +15 -0
  38. data/examples/rails5_app/config/boot.rb +3 -0
  39. data/examples/rails5_app/config/cable.yml +9 -0
  40. data/examples/rails5_app/config/database.yml +25 -0
  41. data/examples/rails5_app/config/environment.rb +5 -0
  42. data/examples/rails5_app/config/environments/development.rb +56 -0
  43. data/examples/rails5_app/config/environments/production.rb +86 -0
  44. data/examples/rails5_app/config/environments/test.rb +42 -0
  45. data/examples/rails5_app/config/initializers/application_controller_renderer.rb +6 -0
  46. data/examples/rails5_app/config/initializers/assets.rb +11 -0
  47. data/examples/rails5_app/config/initializers/backtrace_silencers.rb +7 -0
  48. data/examples/rails5_app/config/initializers/cookies_serializer.rb +5 -0
  49. data/examples/rails5_app/config/initializers/devise.rb +274 -0
  50. data/examples/rails5_app/config/initializers/filter_parameter_logging.rb +4 -0
  51. data/examples/rails5_app/config/initializers/inflections.rb +16 -0
  52. data/examples/rails5_app/config/initializers/mime_types.rb +4 -0
  53. data/examples/rails5_app/config/initializers/new_framework_defaults.rb +24 -0
  54. data/examples/rails5_app/config/initializers/session_store.rb +3 -0
  55. data/examples/rails5_app/config/initializers/wrap_parameters.rb +14 -0
  56. data/examples/rails5_app/config/locales/devise.en.yml +62 -0
  57. data/examples/rails5_app/config/locales/en.yml +23 -0
  58. data/examples/rails5_app/config/puma.rb +47 -0
  59. data/examples/rails5_app/config/routes.rb +4 -0
  60. data/examples/rails5_app/config/secrets.yml +22 -0
  61. data/examples/rails5_app/config/spring.rb +6 -0
  62. data/examples/rails5_app/config.ru +5 -0
  63. data/examples/rails5_app/db/migrate/20170307140813_devise_create_users.rb +49 -0
  64. data/examples/rails5_app/db/migrate/20170307145547_add_password_salt_to_users.rb +5 -0
  65. data/examples/rails5_app/db/schema.rb +44 -0
  66. data/examples/rails5_app/db/seeds.rb +7 -0
  67. data/examples/rails5_app/lib/assets/.keep +0 -0
  68. data/examples/rails5_app/lib/tasks/.keep +0 -0
  69. data/examples/rails5_app/log/.keep +0 -0
  70. data/examples/rails5_app/public/404.html +67 -0
  71. data/examples/rails5_app/public/422.html +67 -0
  72. data/examples/rails5_app/public/500.html +66 -0
  73. data/examples/rails5_app/public/apple-touch-icon-precomposed.png +0 -0
  74. data/examples/rails5_app/public/apple-touch-icon.png +0 -0
  75. data/examples/rails5_app/public/favicon.ico +0 -0
  76. data/examples/rails5_app/public/robots.txt +5 -0
  77. data/examples/rails5_app/test/controllers/.keep +0 -0
  78. data/examples/rails5_app/test/fixtures/.keep +0 -0
  79. data/examples/rails5_app/test/fixtures/files/.keep +0 -0
  80. data/examples/rails5_app/test/helpers/.keep +0 -0
  81. data/examples/rails5_app/test/integration/.keep +0 -0
  82. data/examples/rails5_app/test/mailers/.keep +0 -0
  83. data/examples/rails5_app/test/models/.keep +0 -0
  84. data/examples/rails5_app/test/test_helper.rb +10 -0
  85. data/examples/rails5_app/tmp/.keep +0 -0
  86. data/examples/rails5_app/vendor/assets/javascripts/.keep +0 -0
  87. data/examples/rails5_app/vendor/assets/stylesheets/.keep +0 -0
  88. data/gemfiles/rails_4_2.gemfile +5 -0
  89. data/gemfiles/rails_5_0.gemfile +5 -0
  90. data/gemfiles/rails_5_1.gemfile +5 -0
  91. data/lib/devise/multi_email/association_manager.rb +30 -0
  92. data/lib/devise/multi_email/email_model_extensions.rb +20 -0
  93. data/lib/devise/multi_email/email_model_manager.rb +18 -0
  94. data/lib/devise/multi_email/models/authenticatable.rb +23 -44
  95. data/lib/devise/multi_email/models/confirmable.rb +20 -21
  96. data/lib/devise/multi_email/models/validatable.rb +42 -38
  97. data/lib/devise/multi_email/parent_model_extensions.rb +27 -0
  98. data/lib/devise/multi_email/parent_model_manager.rb +55 -0
  99. data/lib/devise/multi_email/version.rb +1 -1
  100. data/lib/devise/multi_email.rb +32 -0
  101. metadata +147 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 761e1bd9778356e36ea03f9e3e6d1b52acb11aea
4
- data.tar.gz: 14dc6f85dee81396aef5794575b6b27dff79ab3d
3
+ metadata.gz: ae0a4824abdf90e63b3a5027520c2d4ef6465e31
4
+ data.tar.gz: ae37353431e7e16eb565a0ba27c814020f644f3e
5
5
  SHA512:
6
- metadata.gz: 4bc72f639a6dd6503aa415901a09bd47a512f3a63f822111b91fc50688cf32226e01e8942e9cbf1f31314c376496cf6cd608c725cff02a7284b5703cb96ebae9
7
- data.tar.gz: '08d80d91add8d86df88ba7b671829ce783850f17dd1fd2539d06d43b3709e7fa7b079873f0b64a5aa5bea291943f924e18bb98ed445384872a5fddc9ba2c4a69'
6
+ metadata.gz: 232a734290ad0eab39000b8ecb76a3c6fc320ece267fdd43a52a1dadf726ee50cd97dae4c712de750a757ca48bbf72e9b7d6fc59b3e138b32414ee6b9d915e06
7
+ data.tar.gz: 658d6b2220f1eaf9ca811d4df1b669a938cb7a2911c803abc5546eec9def051756511228eff406b282d7e088084fd8610b7950b88f6d71f2ded2876a187e59f2
data/.travis.yml CHANGED
@@ -1,5 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3.0
4
3
  - 2.3.1
4
+ - 2.4.1
5
+ gemfile:
6
+ - gemfiles/rails_5_0.gemfile
7
+ - gemfiles/rails_4_2.gemfile
5
8
  before_install: gem install bundler -v 1.10.6
data/CHANGELOG.md CHANGED
@@ -1,12 +1,25 @@
1
+ ### 2.0.0 - 2017-05-12
2
+
3
+ * New `Devise::MultiEmail#configure` setup with options for `user` and `emails` associations and `primary_email` method names
4
+ * Refactor to expose `_multi_email_*` prefixed methods on models
5
+ * New `primary_email` method to get primary email record (however, can be configured as `primary_email_record` for backwards-compatibility)
6
+ * Changed logic when changing an email address to look up existing email record, otherwise creating a new one, then marking it "primary"
7
+ * Changed logic when changing an email address to mark all others as `primary = false`
8
+ * Changed logic when changing an email address to `nil` to mark as `primary = false` rather than deleting records
9
+
10
+ Many thanks to [joelvh](https://github.com/joelvh) for the great work!
11
+
1
12
  ### 1.0.5 - 2016-12-29
2
- * New `.find_by_email` method. Thanks to [mrjlynch](https://github.com/mrjlynch).
13
+
14
+ * New `.find_by_email` method. Thanks to [mrjlynch](https://github.com/mrjlynch).
3
15
 
4
16
  ### 1.0.4 - 2016-08-13
17
+
5
18
  * Bug fix: Case-insentive configuration of email is ignored (#1). Thanks to [@fonglh](https://github.com/fonglh).
6
19
 
7
20
  ### 1.0.3 - 2016-02-18
8
21
 
9
- * Bug fix: Fix a wrong error message which shows "Email can't be blank" when email does not exist.
22
+ * Bug fix: Fix a wrong error message which shows "Email can't be blank" when email does not exist.
10
23
 
11
24
  ### 1.0.2 - 2016-01-12
12
25
 
data/Gemfile CHANGED
@@ -1,14 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in devise-multi_email.gemspec
4
- gemspec
5
-
6
3
  gem 'rails'
7
4
 
8
- group :development, :test do
9
- gem 'rspec', '~> 3'
10
- gem 'sqlite3'
11
- gem 'capybara'
12
- gem 'coveralls', require: false
13
- end
5
+ # Specify your gem's dependencies in devise-multi_email.gemspec
6
+ gemspec
14
7
 
data/README.md CHANGED
@@ -1,22 +1,22 @@
1
1
  # Devise::MultiEmail [![Build Status](https://travis-ci.org/allenwq/devise-multi_email.svg?branch=master)](https://travis-ci.org/allenwq/devise-multi_email) [![Coverage Status](https://coveralls.io/repos/allenwq/devise-multi_email/badge.svg?branch=master&service=github)](https://coveralls.io/github/allenwq/devise-multi_email?branch=master)
2
2
 
3
- Let [devise](https://github.com/plataformatec/devise) support multilpe emails, it allows you to:
3
+ Letting [Devise](https://github.com/plataformatec/devise) support multiple emails, allows you to:
4
4
  - Login with multiple emails
5
5
  - Send confirmations to multiple emails
6
6
  - Recover the password with any of the emails
7
- - Validations for multiple emails
7
+ - Validations for multiple emails
8
8
 
9
- `:multi_email_authenticatable`, `:multi_email_confirmable` and `:multi_email_validatable` are provided by devise-multi_email.
9
+ `:multi_email_authenticatable`, `:multi_email_confirmable` and `:multi_email_validatable` are provided by _devise-multi_email_.
10
10
 
11
11
  ## Getting Started
12
12
 
13
- Add this line to your application's Gemfile, devise-multi_email has been tested with devise 4.0 and rails 4.2:
13
+ Add this line to your application's `Gemfile`, _devise-multi_email_ has been tested with Devise 4.0 and rails 4.2:
14
14
 
15
15
  ```ruby
16
16
  gem 'devise-multi_email'
17
17
  ```
18
18
 
19
- Suppose you have already setup devise, your `User` model might look like this:
19
+ Suppose you have already setup Devise, your `User` model might look like this:
20
20
 
21
21
  ```ruby
22
22
  class User < ActiveRecord::Base
@@ -24,7 +24,7 @@ class User < ActiveRecord::Base
24
24
  end
25
25
  ```
26
26
 
27
- In order to let your `User` support multiple emails, with `devise-multi_email` what you need to do is just:
27
+ In order to let your `User` support multiple emails, with _devise-multi_email_ what you need to do is just:
28
28
 
29
29
  ```ruby
30
30
  class User < ActiveRecord::Base
@@ -39,7 +39,8 @@ class Email < ActiveRecord::Base
39
39
  end
40
40
  ```
41
41
 
42
- Note that `:email` column should be moved from users table to the emails table, and a new `primary` boolean column should be added to the emails table (so that all the emails will be sent to the primary email, and `user.email` will give you the primary email address). Your emails table's migration should look like:
42
+ Note that the `:email` column should be moved from `users` table to the `emails` table, and a new `primary` boolean column should be added to the `emails` table (so that all the emails will be sent to the primary email, and `user.email` will give you the primary email address). Your `emails` table's migration should look like:
43
+
43
44
  ```ruby
44
45
  create_table :emails do |t|
45
46
  t.integer :user_id
@@ -48,20 +49,48 @@ create_table :emails do |t|
48
49
  end
49
50
  ```
50
51
 
52
+ ### Configure custom association names
53
+
54
+ You may not want to use the association `user.emails` or `email.users`. You can customize the name of the associations used. Add your custom configurations to an initializer file such as `config/initializers/devise-multi_email.rb`.
55
+
56
+ _Note: model classes are inferred from the associations._
57
+
58
+ ```ruby
59
+ Devise::MultiEmail.configure do |config|
60
+ # Default is :user for Email model
61
+ config.parent_association_name = :team
62
+ # Default is :emails for parent (e.g. User) model
63
+ config.emails_association_name = :email_addresses
64
+ # For backwards-compatibility, specify :primary_email_record
65
+ # Default is :primary_email
66
+ config.primary_email_method_name = :primary_email_record
67
+ end
68
+
69
+ # Example use of custom association names
70
+ team = Team.first
71
+ emails = team.email_addresses
72
+
73
+ email = EmailAddress.first
74
+ team = email.team
75
+ ```
76
+
51
77
  ## Confirmable with multiple emails
52
- Sending different confirmaitons to different emails is supported. What you need to do is:
78
+
79
+ Sending separate confirmations to each email is supported. What you need to do is:
53
80
 
54
81
  Declare `devise :multi_email_confirmable` in your `User` model:
82
+
55
83
  ```ruby
56
84
  class User < ActiveRecord::Base
57
85
  has_many :emails
58
86
 
59
- # You should not declare :confiramble and :multi_email_confirmable at the same time.
87
+ # You should not declare :confirmable and :multi_email_confirmable at the same time.
60
88
  devise :multi_email_authenticatable, :registerable, :multi_email_confirmable
61
89
  end
62
90
  ```
63
91
 
64
- Add `:confirmation_token`, `:confirmed_at` and `:confirmation_sent_at` to your emails table:
92
+ Add `:confirmation_token`, `:confirmed_at` and `:confirmation_sent_at` to your `emails` table:
93
+
65
94
  ```ruby
66
95
  create_table :emails do |t|
67
96
  t.integer :user_id
@@ -69,16 +98,18 @@ create_table :emails do |t|
69
98
  t.boolean :primary, default: false
70
99
 
71
100
  ## Confirmable
72
- t.string :confirmation_token
101
+ t.string :unconfirmed_email
102
+ t.string :confirmation_token
73
103
  t.datetime :confirmed_at
74
104
  t.datetime :confirmation_sent_at
75
105
  end
76
106
  ```
77
107
 
78
- Then all the methods in devise confirmable are avalible in your `Email` model. You can do `Email#send_confirmation_instructions` for each of your email. And `User#send_confirmation_instructions` will be delegated to the primary email.
108
+ Then all the methods in Devise confirmable are available in your `Email` model. You can do `email#send_confirmation_instructions` for each of your email. And `user#send_confirmation_instructions` will be delegated to the primary email.
79
109
 
80
110
  ## Validatable with multiple emails
81
- Declare `devise :multi_email_validatable` in the user model, then all the user emails will be validated:
111
+
112
+ Declare `devise :multi_email_validatable` in the `User` model, then all the user emails will be validated:
82
113
 
83
114
  ```ruby
84
115
  class User < ActiveRecord::Base
@@ -89,18 +120,39 @@ class User < ActiveRecord::Base
89
120
  end
90
121
  ```
91
122
 
123
+ You can find the detailed configurations in the [rails 5 example app](https://github.com/allenwq/devise-multi_email/tree/master/examples/rails5_app).
124
+
125
+ ## ActiveJob Integration
126
+
127
+ The [Devise README](https://github.com/plataformatec/devise#activejob-integration) describes how to use ActiveJob to deliver emails in the background. Normally you would place the following code in your `User` model, however when using _devise-multi_email_ you should place this in the `Email` model.
128
+
129
+ ```ruby
130
+ # models/email.rb
131
+ def send_devise_notification(notification, *args)
132
+ devise_mailer.send(notification, self, *args).deliver_later
133
+ end
134
+ ```
135
+
92
136
  ## What's more
93
137
 
94
- The gem works with all other devise modules just as normal, you don't need to add the `multi_email` prefix.
138
+ The gem works with all other Devise modules as expected -- you don't need to add the "multi_email" prefix.
139
+
95
140
  ```ruby
96
- devise :multi_email_authenticatable, :multi_email_confirmable, :multi_email_validatable, :lockable,
141
+ class User < ActiveRecord::Base
142
+ devise :multi_email_authenticatable, :multi_email_confirmable, :multi_email_validatable, :lockable,
97
143
  :recoverable, :registerable, :rememberable, :timeoutable, :trackable
144
+ end
98
145
  ```
99
146
 
100
147
  ## Issues
101
- You need to implement add/delete emails for a user as well as set/unset primary email.
102
148
 
103
- You can do `email.send_confirmation_instructions` for every email, but you also need to handle this logic in some place(excpet for the primary email). e.g. After a new email was added by a user, you might want to provide some buttons to allow user to resend confirmation instrucitons for that email.
149
+ You need to implement add/delete emails for a user as well as set/unset "primary" for each email.
150
+
151
+ You can do `email.send_confirmation_instructions` for each email individually, but you need to handle that logic in some place (except for the primary email, which is handled by Devise by default). e.g. After a new email was added by a user, you might want to provide some buttons in the view to allow users to resend confirmation instructions for that email.
152
+
153
+ ## Wiki
154
+
155
+ [Migrating exiting user records](https://github.com/allenwq/devise-multi_email/wiki/Migrating-existing-user-records)
104
156
 
105
157
  ## Development
106
158
 
@@ -116,4 +168,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
116
168
  ## License
117
169
 
118
170
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
119
-
@@ -23,4 +23,8 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_development_dependency 'bundler', '~> 1.10'
25
25
  spec.add_development_dependency 'rake', '~> 10.0'
26
+ spec.add_development_dependency 'rspec'
27
+ spec.add_development_dependency 'sqlite3'
28
+ spec.add_development_dependency 'capybara'
29
+ spec.add_development_dependency 'coveralls'
26
30
  end
@@ -0,0 +1,21 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*
16
+ /tmp/*
17
+ !/log/.keep
18
+ !/tmp/.keep
19
+
20
+ # Ignore Byebug command history file.
21
+ .byebug_history
@@ -0,0 +1,55 @@
1
+ source 'https://rubygems.org'
2
+
3
+ git_source(:github) do |repo_name|
4
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
5
+ "https://github.com/#{repo_name}.git"
6
+ end
7
+
8
+
9
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
10
+ gem 'rails', '~> 5.0.2'
11
+ # Use sqlite3 as the database for Active Record
12
+ gem 'sqlite3'
13
+ # Use Puma as the app server
14
+ gem 'puma', '~> 3.0'
15
+ # Use SCSS for stylesheets
16
+ gem 'sass-rails', '~> 5.0'
17
+ # Use Uglifier as compressor for JavaScript assets
18
+ gem 'uglifier', '>= 1.3.0'
19
+ # See https://github.com/rails/execjs#readme for more supported runtimes
20
+ # gem 'therubyracer', platforms: :ruby
21
+
22
+ # Use jquery as the JavaScript library
23
+ gem 'jquery-rails'
24
+ # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
25
+ gem 'turbolinks', '~> 5'
26
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
27
+ gem 'jbuilder', '~> 2.5'
28
+ # Use Redis adapter to run Action Cable in production
29
+ # gem 'redis', '~> 3.0'
30
+ # Use ActiveModel has_secure_password
31
+ # gem 'bcrypt', '~> 3.1.7'
32
+
33
+ # Use Capistrano for deployment
34
+ # gem 'capistrano-rails', group: :development
35
+
36
+ group :development, :test do
37
+ # Call 'byebug' anywhere in the code to stop execution and get a debugger console
38
+ gem 'byebug', platform: :mri
39
+ end
40
+
41
+ group :development do
42
+ # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
43
+ gem 'web-console', '>= 3.3.0'
44
+ gem 'listen', '~> 3.0.5'
45
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
46
+ gem 'spring'
47
+ gem 'spring-watcher-listen', '~> 2.0.0'
48
+ end
49
+
50
+ # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
51
+ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
52
+
53
+ gem 'devise'
54
+ gem 'devise-multi_email'
55
+ gem 'devise-encryptable'
@@ -0,0 +1,185 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ actioncable (5.0.2)
5
+ actionpack (= 5.0.2)
6
+ nio4r (>= 1.2, < 3.0)
7
+ websocket-driver (~> 0.6.1)
8
+ actionmailer (5.0.2)
9
+ actionpack (= 5.0.2)
10
+ actionview (= 5.0.2)
11
+ activejob (= 5.0.2)
12
+ mail (~> 2.5, >= 2.5.4)
13
+ rails-dom-testing (~> 2.0)
14
+ actionpack (5.0.2)
15
+ actionview (= 5.0.2)
16
+ activesupport (= 5.0.2)
17
+ rack (~> 2.0)
18
+ rack-test (~> 0.6.3)
19
+ rails-dom-testing (~> 2.0)
20
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
21
+ actionview (5.0.2)
22
+ activesupport (= 5.0.2)
23
+ builder (~> 3.1)
24
+ erubis (~> 2.7.0)
25
+ rails-dom-testing (~> 2.0)
26
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
27
+ activejob (5.0.2)
28
+ activesupport (= 5.0.2)
29
+ globalid (>= 0.3.6)
30
+ activemodel (5.0.2)
31
+ activesupport (= 5.0.2)
32
+ activerecord (5.0.2)
33
+ activemodel (= 5.0.2)
34
+ activesupport (= 5.0.2)
35
+ arel (~> 7.0)
36
+ activesupport (5.0.2)
37
+ concurrent-ruby (~> 1.0, >= 1.0.2)
38
+ i18n (~> 0.7)
39
+ minitest (~> 5.1)
40
+ tzinfo (~> 1.1)
41
+ arel (7.1.4)
42
+ bcrypt (3.1.11)
43
+ builder (3.2.3)
44
+ byebug (9.0.6)
45
+ concurrent-ruby (1.0.5)
46
+ debug_inspector (0.0.2)
47
+ devise (4.2.0)
48
+ bcrypt (~> 3.0)
49
+ orm_adapter (~> 0.1)
50
+ railties (>= 4.1.0, < 5.1)
51
+ responders
52
+ warden (~> 1.2.3)
53
+ devise-encryptable (0.2.0)
54
+ devise (>= 2.1.0)
55
+ devise-multi_email (1.0.5)
56
+ devise
57
+ erubis (2.7.0)
58
+ execjs (2.7.0)
59
+ ffi (1.9.18)
60
+ globalid (0.3.7)
61
+ activesupport (>= 4.1.0)
62
+ i18n (0.8.1)
63
+ jbuilder (2.6.3)
64
+ activesupport (>= 3.0.0, < 5.2)
65
+ multi_json (~> 1.2)
66
+ jquery-rails (4.2.2)
67
+ rails-dom-testing (>= 1, < 3)
68
+ railties (>= 4.2.0)
69
+ thor (>= 0.14, < 2.0)
70
+ listen (3.0.8)
71
+ rb-fsevent (~> 0.9, >= 0.9.4)
72
+ rb-inotify (~> 0.9, >= 0.9.7)
73
+ loofah (2.0.3)
74
+ nokogiri (>= 1.5.9)
75
+ mail (2.6.4)
76
+ mime-types (>= 1.16, < 4)
77
+ method_source (0.8.2)
78
+ mime-types (3.1)
79
+ mime-types-data (~> 3.2015)
80
+ mime-types-data (3.2016.0521)
81
+ mini_portile2 (2.1.0)
82
+ minitest (5.10.1)
83
+ multi_json (1.12.1)
84
+ nio4r (2.0.0)
85
+ nokogiri (1.7.0.1)
86
+ mini_portile2 (~> 2.1.0)
87
+ orm_adapter (0.5.0)
88
+ puma (3.7.1)
89
+ rack (2.0.1)
90
+ rack-test (0.6.3)
91
+ rack (>= 1.0)
92
+ rails (5.0.2)
93
+ actioncable (= 5.0.2)
94
+ actionmailer (= 5.0.2)
95
+ actionpack (= 5.0.2)
96
+ actionview (= 5.0.2)
97
+ activejob (= 5.0.2)
98
+ activemodel (= 5.0.2)
99
+ activerecord (= 5.0.2)
100
+ activesupport (= 5.0.2)
101
+ bundler (>= 1.3.0, < 2.0)
102
+ railties (= 5.0.2)
103
+ sprockets-rails (>= 2.0.0)
104
+ rails-dom-testing (2.0.2)
105
+ activesupport (>= 4.2.0, < 6.0)
106
+ nokogiri (~> 1.6)
107
+ rails-html-sanitizer (1.0.3)
108
+ loofah (~> 2.0)
109
+ railties (5.0.2)
110
+ actionpack (= 5.0.2)
111
+ activesupport (= 5.0.2)
112
+ method_source
113
+ rake (>= 0.8.7)
114
+ thor (>= 0.18.1, < 2.0)
115
+ rake (12.0.0)
116
+ rb-fsevent (0.9.8)
117
+ rb-inotify (0.9.8)
118
+ ffi (>= 0.5.0)
119
+ responders (2.3.0)
120
+ railties (>= 4.2.0, < 5.1)
121
+ sass (3.4.23)
122
+ sass-rails (5.0.6)
123
+ railties (>= 4.0.0, < 6)
124
+ sass (~> 3.1)
125
+ sprockets (>= 2.8, < 4.0)
126
+ sprockets-rails (>= 2.0, < 4.0)
127
+ tilt (>= 1.1, < 3)
128
+ spring (2.0.1)
129
+ activesupport (>= 4.2)
130
+ spring-watcher-listen (2.0.1)
131
+ listen (>= 2.7, < 4.0)
132
+ spring (>= 1.2, < 3.0)
133
+ sprockets (3.7.1)
134
+ concurrent-ruby (~> 1.0)
135
+ rack (> 1, < 3)
136
+ sprockets-rails (3.2.0)
137
+ actionpack (>= 4.0)
138
+ activesupport (>= 4.0)
139
+ sprockets (>= 3.0.0)
140
+ sqlite3 (1.3.13)
141
+ thor (0.19.4)
142
+ thread_safe (0.3.6)
143
+ tilt (2.0.6)
144
+ turbolinks (5.0.1)
145
+ turbolinks-source (~> 5)
146
+ turbolinks-source (5.0.0)
147
+ tzinfo (1.2.2)
148
+ thread_safe (~> 0.1)
149
+ uglifier (3.1.4)
150
+ execjs (>= 0.3.0, < 3)
151
+ warden (1.2.7)
152
+ rack (>= 1.0)
153
+ web-console (3.4.0)
154
+ actionview (>= 5.0)
155
+ activemodel (>= 5.0)
156
+ debug_inspector
157
+ railties (>= 5.0)
158
+ websocket-driver (0.6.5)
159
+ websocket-extensions (>= 0.1.0)
160
+ websocket-extensions (0.1.2)
161
+
162
+ PLATFORMS
163
+ ruby
164
+
165
+ DEPENDENCIES
166
+ byebug
167
+ devise
168
+ devise-encryptable
169
+ devise-multi_email
170
+ jbuilder (~> 2.5)
171
+ jquery-rails
172
+ listen (~> 3.0.5)
173
+ puma (~> 3.0)
174
+ rails (~> 5.0.2)
175
+ sass-rails (~> 5.0)
176
+ spring
177
+ spring-watcher-listen (~> 2.0.0)
178
+ sqlite3
179
+ turbolinks (~> 5)
180
+ tzinfo-data
181
+ uglifier (>= 1.3.0)
182
+ web-console (>= 3.3.0)
183
+
184
+ BUNDLED WITH
185
+ 1.13.6
@@ -0,0 +1,24 @@
1
+ # README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative 'config/application'
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,3 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../javascripts .js
3
+ //= link_directory ../stylesheets .css
File without changes
@@ -0,0 +1,16 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require turbolinks
16
+ //= require_tree .
@@ -0,0 +1,13 @@
1
+ // Action Cable provides the framework to deal with WebSockets in Rails.
2
+ // You can generate new channels where WebSocket features live using the rails generate channel command.
3
+ //
4
+ //= require action_cable
5
+ //= require_self
6
+ //= require_tree ./channels
7
+
8
+ (function() {
9
+ this.App || (this.App = {});
10
+
11
+ App.cable = ActionCable.createConsumer();
12
+
13
+ }).call(this);
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Channel < ActionCable::Channel::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Connection < ActionCable::Connection::Base
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery with: :exception
3
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: 'from@example.com'
3
+ layout 'mailer'
4
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
File without changes
@@ -0,0 +1,3 @@
1
+ class Email < ApplicationRecord
2
+ belongs_to :user
3
+ end
@@ -0,0 +1,9 @@
1
+ class User < ApplicationRecord
2
+ has_many :emails
3
+ # Include default devise modules. Others available are:
4
+ # :lockable, :timeoutable and :omniauthable
5
+ devise :multi_email_authenticatable, :multi_email_confirmable, :multi_email_validatable,
6
+ :recoverable, :registerable, :rememberable, :trackable,
7
+ # Below are for testing purpose, not required by default
8
+ :encryptable, encryptor: :sha512
9
+ end