muck-users 0.3.14 → 0.3.15
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.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.15
|
@@ -51,6 +51,7 @@ class Muck::UsersController < ApplicationController
|
|
51
51
|
@page_title = t('muck.users.register_account', :application_name => GlobalConfig.application_name)
|
52
52
|
cookies.delete :auth_token
|
53
53
|
@user = User.new(params[:user])
|
54
|
+
@user.terms_of_service = true if params[:user][:terms_of_service] # This value is not mass updatable and must be set manually.
|
54
55
|
check_access_code
|
55
56
|
check_recaptcha
|
56
57
|
success, path = setup_user
|
@@ -44,6 +44,11 @@ module ActiveRecord
|
|
44
44
|
extend ActiveRecord::Acts::MuckUser::SingletonMethods
|
45
45
|
|
46
46
|
end
|
47
|
+
|
48
|
+
def validates_terms_of_service
|
49
|
+
validate_on_create :accepts_terms_of_service?
|
50
|
+
end
|
51
|
+
|
47
52
|
end
|
48
53
|
|
49
54
|
# class methods
|
@@ -198,6 +203,12 @@ module ActiveRecord
|
|
198
203
|
CGI::escapeHTML(self.login)
|
199
204
|
end
|
200
205
|
|
206
|
+
def accepts_terms_of_service?
|
207
|
+
if !self.terms_of_service
|
208
|
+
errors.add_to_base(I18n.translate('muck.users.terms_of_service_required'))
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
201
212
|
end
|
202
213
|
end
|
203
214
|
end
|
data/locales/en.yml
CHANGED
@@ -77,6 +77,7 @@ en:
|
|
77
77
|
cannot_deactivate_yourself: You cannot deactivate yourself!
|
78
78
|
bulk_access_codes_description: This will generate a unique, single use access code for each of the emails provided.
|
79
79
|
add: Add
|
80
|
+
terms_of_service_required: You must accept the terms of service.
|
80
81
|
admin:
|
81
82
|
activate_all_inactive_users_confirm: Are you sure you want to activate all inactive users in the system? This cannot be undone!
|
82
83
|
activate_all_inactive_users: Activate All Inactive Users
|
data/muck-users.gemspec
CHANGED
@@ -118,6 +118,16 @@ class UserTest < ActiveSupport::TestCase
|
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
121
|
+
context "terms of service set to false" do
|
122
|
+
setup do
|
123
|
+
@user = Factory.build(:user, :terms_of_service => false)
|
124
|
+
end
|
125
|
+
should "not create the user" do
|
126
|
+
assert !@user.valid?
|
127
|
+
assert @user.errors.full_messages.include?(I18n.translate('muck.users.terms_of_service_required'))
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
121
131
|
context "a user" do
|
122
132
|
should "have full name" do
|
123
133
|
assert_difference 'User.count' do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muck-users
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 15
|
10
|
+
version: 0.3.15
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Justin Ball
|