devise_invitable 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/devise_invitable.gemspec +6 -7
- data/init.rb +1 -1
- data/lib/devise_invitable.rb +4 -0
- data/lib/{devise → devise_invitable}/controllers/helpers.rb +1 -1
- data/lib/{devise → devise_invitable}/controllers/url_helpers.rb +1 -1
- data/lib/devise_invitable/mailer.rb +1 -1
- data/lib/devise_invitable/model.rb +3 -3
- data/lib/devise_invitable/routes.rb +1 -1
- data/test/rails_app/config/environment.rb +1 -1
- data/test/test_helper.rb +1 -1
- metadata +6 -7
- data/rails/init.rb +0 -1
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ begin
|
|
12
12
|
gem.authors = ["Sergio Cambra"]
|
13
13
|
gem.add_development_dependency 'mocha'
|
14
14
|
gem.add_development_dependency 'webrat'
|
15
|
-
gem.add_dependency 'devise', '~> 1.0
|
15
|
+
gem.add_dependency 'devise', '~> 1.1.0'
|
16
16
|
end
|
17
17
|
Jeweler::GemcutterTasks.new
|
18
18
|
rescue LoadError
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/devise_invitable.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{devise_invitable}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Sergio Cambra"]
|
@@ -29,16 +29,15 @@ Gem::Specification.new do |s|
|
|
29
29
|
"app/views/invitations/new.html.erb",
|
30
30
|
"devise_invitable.gemspec",
|
31
31
|
"init.rb",
|
32
|
-
"lib/devise/controllers/helpers.rb",
|
33
|
-
"lib/devise/controllers/url_helpers.rb",
|
34
32
|
"lib/devise_invitable.rb",
|
33
|
+
"lib/devise_invitable/controllers/helpers.rb",
|
34
|
+
"lib/devise_invitable/controllers/url_helpers.rb",
|
35
35
|
"lib/devise_invitable/locales/en.yml",
|
36
36
|
"lib/devise_invitable/mailer.rb",
|
37
37
|
"lib/devise_invitable/model.rb",
|
38
38
|
"lib/devise_invitable/rails.rb",
|
39
39
|
"lib/devise_invitable/routes.rb",
|
40
40
|
"lib/devise_invitable/schema.rb",
|
41
|
-
"rails/init.rb",
|
42
41
|
"test/integration/invitable_test.rb",
|
43
42
|
"test/integration_tests_helper.rb",
|
44
43
|
"test/mailers/invitation_test.rb",
|
@@ -109,16 +108,16 @@ Gem::Specification.new do |s|
|
|
109
108
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
110
109
|
s.add_development_dependency(%q<mocha>, [">= 0"])
|
111
110
|
s.add_development_dependency(%q<webrat>, [">= 0"])
|
112
|
-
s.add_runtime_dependency(%q<devise>, ["~> 1.0
|
111
|
+
s.add_runtime_dependency(%q<devise>, ["~> 1.1.0"])
|
113
112
|
else
|
114
113
|
s.add_dependency(%q<mocha>, [">= 0"])
|
115
114
|
s.add_dependency(%q<webrat>, [">= 0"])
|
116
|
-
s.add_dependency(%q<devise>, ["~> 1.0
|
115
|
+
s.add_dependency(%q<devise>, ["~> 1.1.0"])
|
117
116
|
end
|
118
117
|
else
|
119
118
|
s.add_dependency(%q<mocha>, [">= 0"])
|
120
119
|
s.add_dependency(%q<webrat>, [">= 0"])
|
121
|
-
s.add_dependency(%q<devise>, ["~> 1.0
|
120
|
+
s.add_dependency(%q<devise>, ["~> 1.1.0"])
|
122
121
|
end
|
123
122
|
end
|
124
123
|
|
data/init.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
require '
|
1
|
+
require 'devise_invitable'
|
data/lib/devise_invitable.rb
CHANGED
@@ -39,7 +39,7 @@ module Devise
|
|
39
39
|
|
40
40
|
# Send invitation by email
|
41
41
|
def send_invitation
|
42
|
-
::
|
42
|
+
::Devise::Mailer.invitation(self).deliver
|
43
43
|
end
|
44
44
|
|
45
45
|
# Reset invitation token and send invitation again
|
@@ -47,7 +47,7 @@ module Devise
|
|
47
47
|
if new_record? || invited?
|
48
48
|
self.skip_confirmation! if self.new_record? and self.respond_to? :skip_confirmation!
|
49
49
|
generate_invitation_token
|
50
|
-
save(false)
|
50
|
+
save(:validate=>false)
|
51
51
|
send_invitation
|
52
52
|
end
|
53
53
|
end
|
@@ -101,7 +101,7 @@ module Devise
|
|
101
101
|
|
102
102
|
if invitable.new_record?
|
103
103
|
invitable.errors.add(:email, :blank) if invitable.email.blank?
|
104
|
-
invitable.errors.add(:email, :invalid) unless invitable.email.match Devise
|
104
|
+
invitable.errors.add(:email, :invalid) unless invitable.email.match Devise.email_regexp
|
105
105
|
else
|
106
106
|
invitable.errors.add(:email, :taken) unless invitable.invited?
|
107
107
|
end
|
@@ -19,7 +19,7 @@ Rails::Initializer.run do |config|
|
|
19
19
|
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
|
20
20
|
# config.gem "sqlite3-ruby", :lib => "sqlite3"
|
21
21
|
# config.gem "aws-s3", :lib => "aws/s3"
|
22
|
-
config.gem 'devise'
|
22
|
+
# config.gem 'devise'
|
23
23
|
|
24
24
|
# Only load the plugins named here, in the order given (default is alphabetical).
|
25
25
|
# :all can be used as a placeholder for all plugins not explicitly named
|
data/test/test_helper.rb
CHANGED
@@ -10,7 +10,7 @@ ActionView::Base.send :include, Devise::Controllers::UrlHelpers
|
|
10
10
|
|
11
11
|
path = File.join(File.dirname(__FILE__), '..', 'app', 'views')
|
12
12
|
ActionController::Base.view_paths << path
|
13
|
-
|
13
|
+
Devise::Mailer.view_paths << path
|
14
14
|
|
15
15
|
ActionMailer::Base.delivery_method = :test
|
16
16
|
ActionMailer::Base.perform_deliveries = true
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
- 2
|
8
7
|
- 3
|
9
|
-
|
8
|
+
- 0
|
9
|
+
version: 0.3.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Sergio Cambra
|
@@ -50,9 +50,9 @@ dependencies:
|
|
50
50
|
- !ruby/object:Gem::Version
|
51
51
|
segments:
|
52
52
|
- 1
|
53
|
+
- 1
|
53
54
|
- 0
|
54
|
-
|
55
|
-
version: 1.0.6
|
55
|
+
version: 1.1.0
|
56
56
|
type: :runtime
|
57
57
|
version_requirements: *id003
|
58
58
|
description: It adds support for send invitations by email (it requires to be authenticated) and accept the invitation setting the password
|
@@ -77,16 +77,15 @@ files:
|
|
77
77
|
- app/views/invitations/new.html.erb
|
78
78
|
- devise_invitable.gemspec
|
79
79
|
- init.rb
|
80
|
-
- lib/devise/controllers/helpers.rb
|
81
|
-
- lib/devise/controllers/url_helpers.rb
|
82
80
|
- lib/devise_invitable.rb
|
81
|
+
- lib/devise_invitable/controllers/helpers.rb
|
82
|
+
- lib/devise_invitable/controllers/url_helpers.rb
|
83
83
|
- lib/devise_invitable/locales/en.yml
|
84
84
|
- lib/devise_invitable/mailer.rb
|
85
85
|
- lib/devise_invitable/model.rb
|
86
86
|
- lib/devise_invitable/rails.rb
|
87
87
|
- lib/devise_invitable/routes.rb
|
88
88
|
- lib/devise_invitable/schema.rb
|
89
|
-
- rails/init.rb
|
90
89
|
- test/integration/invitable_test.rb
|
91
90
|
- test/integration_tests_helper.rb
|
92
91
|
- test/mailers/invitation_test.rb
|
data/rails/init.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'devise_invitable'
|