devise_invitable 0.4.1 → 0.4.2

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.

data/README.rdoc CHANGED
@@ -61,7 +61,7 @@ or for a model that already exists, define a migration to add DeviseInvitable to
61
61
 
62
62
  == Model configuration
63
63
 
64
- DeviseInvitable adds three new configuration options:
64
+ DeviseInvitable adds four new configuration options:
65
65
 
66
66
  * invite_for: The period the generated invitation token is valid, after this period, the invited resource won't be able to accept the invitation. When invite_for is 0 (the default), the invitation won't expire.
67
67
 
@@ -81,6 +81,8 @@ or directly as parameters to the <tt>devise</tt> method:
81
81
 
82
82
  * invite_key: The key to be used to check existing users when sending an invitation. The key must be an unique field. The default value is looking for users by email.
83
83
 
84
+ * validate_on_invite: force a record to be valid before being actually invited.
85
+
84
86
  For more details, see <tt>config/initializers/devise.rb</tt> (after you invoked the "devise_invitable:install" generator described above).
85
87
 
86
88
  == Configuring views
@@ -84,7 +84,7 @@ module Devise
84
84
  def decrement_invitation_limit!
85
85
  if self.class.invitation_limit.present?
86
86
  self.invitation_limit ||= self.class.invitation_limit
87
- self.decrement!(:invitation_limit)
87
+ self.update_attribute(:invitation_limit, invitation_limit - 1)
88
88
  end
89
89
  end
90
90
 
@@ -1,3 +1,3 @@
1
1
  module DeviseInvitable
2
- VERSION = '0.4.1'
2
+ VERSION = '0.4.2'
3
3
  end
@@ -18,8 +18,8 @@ class DeviseInvitableAddTo<%= table_name.camelize %> < ActiveRecord::Migration
18
18
 
19
19
  def self.down
20
20
  change_table :<%= table_name %> do |t|
21
- remove_references :invited_by, :polymorphic => true
22
- remove :invitation_limit, :invitation_sent_at, :invitation_token
21
+ t.remove_references :invited_by, :polymorphic => true
22
+ t.remove :invitation_limit, :invitation_sent_at, :invitation_token
23
23
  end
24
24
  end
25
25
  end
@@ -34,6 +34,10 @@ module DeviseInvitable
34
34
  # The key to be used to check existing users when sending an invitation
35
35
  # config.invite_key = :email
36
36
 
37
+ # Flag that force a record to be valid before being actually invited
38
+ # Default: false
39
+ # config.validate_on_invite = true
40
+
37
41
  CONTENT
38
42
  end
39
43
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_invitable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 1
10
- version: 0.4.1
9
+ - 2
10
+ version: 0.4.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sergio Cambra
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-01 00:00:00 +02:00
18
+ date: 2011-04-25 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -56,7 +56,7 @@ dependencies:
56
56
  requirement: &id003 !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
- - - ~>
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  hash: 31
62
62
  segments:
@@ -64,6 +64,14 @@ dependencies:
64
64
  - 2
65
65
  - 0
66
66
  version: 1.2.0
67
+ - - <=
68
+ - !ruby/object:Gem::Version
69
+ hash: 7
70
+ segments:
71
+ - 1
72
+ - 4
73
+ - 0
74
+ version: 1.4.0
67
75
  type: :runtime
68
76
  version_requirements: *id003
69
77
  description: It adds support for send invitations by email (it requires to be authenticated) and accept the invitation by setting a password.