README.md in mr_common-1.3.0 vs README.md in mr_common-2.0.0
- old
+ new
@@ -2,10 +2,11 @@
Common utilities extracted from starter-reg-site for use elsewhere
## Features
* Dashboard at the mount point that relies on the host app for authentication
* [MrCommon::Registration](/doc/mr_common/registration.md) - default registration model and controller with csv export exposed via the dashboard
+* MrCommon::PreRegistration - whitelist firstname + lastname combos, or emails for automatic registration confirmation, requires `MrCommon.registration_confirmation_strategy == :pre_register`
* [MrCommon::Reminder](/doc/mr_common/reminder.md) - model for generating downloadable ical reminders
* MrCommon::Country - convenient wrapper around the Carmen gem
* MrCommon::Pattern - a utility class for sharing common regex patterns
* MrCommon::Concerns::CSVExportable - include to add `.as_csv` to any ActiveRecord model
@@ -14,11 +15,11 @@
Add to Gemfile
```ruby
# Gemfile
-gem 'mr_common', '~> 1'
+gem 'mr_common', '~> 2'
```
Add to routes.rb
```ruby
# config/routes.rb
@@ -27,14 +28,17 @@
# set the host app's root route to the default registration
# form, and override the the templates. (See MrCommon::Reminder for more instructions )
root to: "mr_common/registrations/public#new"
```
-Generate view overrides in the host project
+Copy model/controller/views into the host app for overriding/customizing.
```
+$ bin/rails g mr_common:models
$ bin/rails g mr_common:views
+$ bin/rails g mr_common:mailers
+$ bin/rails g mr_common:controllers
```
Configure an initializer if you need different values than the defaults listed here
```ruby
# config/initializers/mr_common.rb
@@ -44,22 +48,39 @@
MrCommon.current_user_method_name = :current_user
MrCommon.current_user_authorization_method_name = :mr_common_admin?
MrCommon.logout_path_helper = :destroy_user_session_path
MrCommon.logout_path_method = :delete
MrCommon.sign_in_path_helper = :new_user_session_path
-MrCommon.registration_success_notice = "Registration completed successfully."
-MrCommon.registration_failure_alert = "Registration could not be completed."
MrCommon.host_app_layout = "application"
-MrCommon.registration_confirmation_subject = "Your registration confirmation."
-MrCommon.registration_reminder_slug = "reminder"
+
+# Alert/Notice strings
+MrCommon.registration_failure_alert = "Registration could not be completed."
+MrCommon.registration_success_notice = "Registration created successfully."
+
+# RegistrationMailer subjects
+MrCommon.registration_confirmed_subject = "Your registration is confirmed."
+MrCommon.registration_unconfirmed_subject = "Thanks for your interest."
+MrCommon.registration_revoked_subject = "Your registration is not confirmed."
+
+# Dashboard Title
+MrCommon.title = "Mreach Common Utils"
+
+# All Registrations will be automatically confirmed (default)
+# MrCommon.registration_confirmation_strategy = :auto
+
+# Registrations will be confirmed automatically if a PreRegistration is found
+# MrCommon.registration_confirmation_strategy = :pre_register
+
+# An admin will need to log in and click the confirm button for each registration
+# MrCommon.registration_confirmation_strategy = :manual
```
## Development
1. `gem install foreman mailcatcher`
-1. Clone
-1. Bundle Install
-1. Don't yarn. Engines have to use old school sprockets manifests
+1. clone
+1. bundle Install
+1. don't use yarn/npm, engines have to use old school sprockets manifests
1. run `bin/rails run` to start the app + mailcatcher.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
\ No newline at end of file