devise_invitable 1.7.3 → 1.7.4

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 120262595eb64c2331645be7ee5b72be56cf69dd
4
- data.tar.gz: 9cf5ffa08b34fe9d69e09272c23f92800b0357f6
3
+ metadata.gz: a5b47a00992074a2cb6a0ae940340430bafdc284
4
+ data.tar.gz: 9348350b9aa008acd22e87b0bd8bf881ec09e190
5
5
  SHA512:
6
- metadata.gz: 2f73d12b8a22bb35067552438a6fa394e150525c54de6e3d25372b0a0d345b4ec74332cdd190075b1b5f4b82b34413115ec1fb650ab83cf20acc3345906daae4
7
- data.tar.gz: a24d5a8744f72552413216e8f7947ff58a7be06fcbc2683cd9caaa9fc4a90b4384b4c89f54c2aa9930bf369da289922dbb9b445824de139f685671a9a6e48a1b
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 = nil)
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
- time && (self.class.invite_for.to_i.zero? || time.utc >= self.class.invite_for.ago)
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
@@ -1,3 +1,3 @@
1
1
  module DeviseInvitable
2
- VERSION = '1.7.3'
2
+ VERSION = '1.7.4'
3
3
  end
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.3
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-02-09 00:00:00.000000000 Z
11
+ date: 2018-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler