invitation 0.4.2 → 0.4.3
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.
- checksums.yaml +4 -4
- data/lib/invitation/configuration.rb +31 -2
- data/lib/invitation/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d31c41d437dc46e7d2b4c95b27fef37fbcb8efc0
|
4
|
+
data.tar.gz: 22ec9ef308cd58df3e518c9d26da2250382db666
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b2f75b71f9aef28f0f0ae5afe71a0b56faa8f9abfcdf472b475ce2c18b7892699b40f5a270f8ff8e9f262bbbcec0172facf1ff78ded8d0ddefd368a8c7fe09c
|
7
|
+
data.tar.gz: e268b4a3d4eb4d8702f11ee18b5109d73bfb152cb7e60d607aef0c76a96e32cc57985f3e79d5267d98908688159cf2797881bbef60fef7efac227e45eaaaedc2
|
@@ -8,9 +8,18 @@ module Invitation
|
|
8
8
|
# end
|
9
9
|
#
|
10
10
|
class Configuration
|
11
|
-
# ActiveRecord
|
11
|
+
# Name of the ActiveRecord class that represents users in your application.
|
12
|
+
#
|
13
|
+
# Example:
|
14
|
+
# Invitation.configure do |config|
|
15
|
+
# config.user_model = 'User'
|
16
|
+
# end
|
17
|
+
#
|
18
|
+
# DEPRECATED: can be set to the user class (not it's name), e.g. `config.user_model = User`.
|
19
|
+
# Support for setting the class directly may be removed in a future update.
|
12
20
|
#
|
13
21
|
# Defaults to '::User'.
|
22
|
+
#
|
14
23
|
# @return [ActiveRecord::Base]
|
15
24
|
attr_accessor :user_model
|
16
25
|
|
@@ -61,8 +70,28 @@ module Invitation
|
|
61
70
|
@case_sensitive_email = true
|
62
71
|
end
|
63
72
|
|
73
|
+
# @return [Class]
|
64
74
|
def user_model
|
65
|
-
|
75
|
+
if !@user_model.respond_to?(:constantize) && @user_model_class.nil?
|
76
|
+
warn <<-EOM.squish
|
77
|
+
Invitation's `user_model` configuration setting should now be set to a string
|
78
|
+
specifying the user model's class name.
|
79
|
+
|
80
|
+
Future versions of Invitation will no longer support setting user_model to a class.
|
81
|
+
|
82
|
+
It is recommended that you opt-in now and set your user model to a class name.
|
83
|
+
Example:
|
84
|
+
Invitation.configure do |config|
|
85
|
+
config.user_model = 'User'
|
86
|
+
end
|
87
|
+
EOM
|
88
|
+
end
|
89
|
+
@user_model_class ||=
|
90
|
+
if @user_model.respond_to?(:constantize)
|
91
|
+
@user_model.constantize
|
92
|
+
else
|
93
|
+
@user_model
|
94
|
+
end
|
66
95
|
end
|
67
96
|
|
68
97
|
def user_model_class_name
|
data/lib/invitation/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: invitation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Tomich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|