devise_invitable 1.7.3 → 1.7.4
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a5b47a00992074a2cb6a0ae940340430bafdc284
|
|
4
|
+
data.tar.gz: 9348350b9aa008acd22e87b0bd8bf881ec09e190
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b7739cf3d0121a6cbd492eabbd6d7ff9c5d2e1cc4016fcc9dae654be285569a034cc881d8672bc6feec407f2b24c85fad98b281a2b79d84fc1eb9986320580d9
|
|
7
|
+
data.tar.gz: 95e436f92ccc7c8828121fc4c7c4ac65d5808bfccb19da4463419939ce48ca6206d13fdb01cc99f47788340731c24f538d0cbfb4a14b954eb6e043350e0b3b18
|
data/README.rdoc
CHANGED
|
@@ -399,6 +399,17 @@ Take a look at the generated locale file (in <tt>config/locales/devise_invitable
|
|
|
399
399
|
|
|
400
400
|
Translations are not included in gem (and they won't), they are available at wiki[https://github.com/scambra/devise_invitable/wiki/I18n].
|
|
401
401
|
|
|
402
|
+
=== Use with sub schema
|
|
403
|
+
If you are using sub schema in you application, you need to make sure that you are prioritizing your sub schema scheme over Warden in Rack.
|
|
404
|
+
For instance, if you are using the Apartment gem go inside your <tt>config/application.rb</tt> file, add the following lines:
|
|
405
|
+
|
|
406
|
+
module YourSite
|
|
407
|
+
class Application < Rails::Application
|
|
408
|
+
...
|
|
409
|
+
Rails.application.config.middleware.insert_before "Warden::Manager", Apartment::Elevators::Subdomain
|
|
410
|
+
end
|
|
411
|
+
end
|
|
412
|
+
|
|
402
413
|
== Other ORMs
|
|
403
414
|
|
|
404
415
|
DeviseInvitable supports ActiveRecord and Mongoid, like Devise.
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
class DeviseInvitable::RegistrationsController < Devise::RegistrationsController
|
|
2
2
|
protected
|
|
3
3
|
|
|
4
|
-
def build_resource(hash =
|
|
5
|
-
hash ||= resource_params || {}
|
|
4
|
+
def build_resource(hash = {})
|
|
6
5
|
if hash[:email]
|
|
7
6
|
self.resource = resource_class.where(:email => hash[:email]).first
|
|
8
7
|
if self.resource && self.resource.respond_to?(:invited_to_sign_up?) && self.resource.invited_to_sign_up?
|
|
@@ -245,7 +245,7 @@ module Devise
|
|
|
245
245
|
#
|
|
246
246
|
def invitation_period_valid?
|
|
247
247
|
time = invitation_created_at || invitation_sent_at
|
|
248
|
-
|
|
248
|
+
self.class.invite_for.to_i.zero? || (time && time.utc >= self.class.invite_for.ago)
|
|
249
249
|
end
|
|
250
250
|
|
|
251
251
|
# Generates a new random token for invitation, and stores the time
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: devise_invitable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.7.
|
|
4
|
+
version: 1.7.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sergio Cambra
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-04-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|