authentasaurus 0.4.14 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELIST +3 -0
- data/TODO +4 -4
- data/app/controllers/areas_controller.rb +2 -1
- data/app/controllers/groups_controller.rb +2 -1
- data/app/controllers/permissions_controller.rb +2 -1
- data/app/controllers/recoveries_controller.rb +2 -1
- data/app/controllers/registrations_controller.rb +2 -1
- data/app/controllers/sessions_controller.rb +2 -1
- data/app/controllers/user_invitations_controller.rb +2 -1
- data/app/controllers/users_controller.rb +2 -1
- data/app/controllers/validations_controller.rb +2 -1
- data/app/models/area.rb +2 -1
- data/app/models/group.rb +2 -1
- data/app/models/permission.rb +2 -1
- data/app/models/recovery.rb +2 -1
- data/app/models/session.rb +2 -1
- data/app/models/user_invitation.rb +2 -1
- data/app/models/validation.rb +2 -1
- data/lib/authentasaurus/areas_controller.rb +77 -68
- data/lib/authentasaurus/groups_controller.rb +78 -70
- data/lib/authentasaurus/models/area.rb +15 -6
- data/lib/authentasaurus/models/group.rb +15 -6
- data/lib/authentasaurus/models/permission.rb +19 -8
- data/lib/authentasaurus/models/recovery.rb +31 -21
- data/lib/authentasaurus/models/session.rb +59 -50
- data/lib/authentasaurus/models/user_invitation.rb +26 -16
- data/lib/authentasaurus/models/validation.rb +25 -15
- data/lib/authentasaurus/permissions_controller.rb +78 -69
- data/lib/authentasaurus/recoveries_controller.rb +62 -52
- data/lib/authentasaurus/registrations_controller.rb +34 -24
- data/lib/authentasaurus/sessions_controller.rb +42 -33
- data/lib/authentasaurus/user_invitations_controller.rb +36 -27
- data/lib/authentasaurus/users_controller.rb +77 -68
- data/lib/authentasaurus/validations_controller.rb +38 -28
- metadata +7 -6
- data/app/controllers/authentasaurus/authentasaurus_controller.rb +0 -2
data/CHANGELIST
ADDED
data/TODO
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
* Update views to use the new flash convention
|
2
|
-
* flash[:notice] for information messages
|
3
|
-
* flash[:alert] for error messages
|
4
|
-
* Localize views
|
1
|
+
* Update views to use the new flash convention [DONE]
|
2
|
+
* flash[:notice] for information messages [DONE]
|
3
|
+
* flash[:alert] for error messages [DONE]
|
4
|
+
* Localize views [DONE]
|
data/app/models/area.rb
CHANGED
data/app/models/group.rb
CHANGED
data/app/models/permission.rb
CHANGED
data/app/models/recovery.rb
CHANGED
data/app/models/session.rb
CHANGED
data/app/models/validation.rb
CHANGED
@@ -1,69 +1,78 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
1
|
+
module Authentasaurus::AreasController
|
2
|
+
def self.included(base) # :nodoc:
|
3
|
+
base.send :extend, ClassMethods
|
4
|
+
base.send :include, InstanceMethods
|
5
|
+
end
|
6
|
+
|
7
|
+
module ClassMethods
|
8
|
+
end
|
9
|
+
|
10
|
+
module InstanceMethods
|
11
|
+
def index
|
12
|
+
@areas= Area.find :all
|
13
|
+
|
14
|
+
respond_to do |format|
|
15
|
+
format.html
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def show
|
20
|
+
@area = Area.find params[:id]
|
21
|
+
|
22
|
+
respond_to do |format|
|
23
|
+
format.html
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def new
|
28
|
+
@area = Area.new
|
29
|
+
|
30
|
+
respond_to do |format|
|
31
|
+
format.html
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def create
|
36
|
+
@area = Area.new params[:area]
|
37
|
+
|
38
|
+
respond_to do |format|
|
39
|
+
if @area.save
|
40
|
+
format.html { redirect_to :action=>:index, :notice => "Area Created" }
|
41
|
+
else
|
42
|
+
flash.now[:alert] = I18n.t(:create_failed, :scope => [:authentasaurus, :messages, :areas])
|
43
|
+
format.html { render :new }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def edit
|
49
|
+
@area = Area.find params[:id]
|
50
|
+
|
51
|
+
respond_to do |format|
|
52
|
+
format.html
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def update
|
57
|
+
@area = Area.find params[:id]
|
58
|
+
|
59
|
+
respond_to do |format|
|
60
|
+
if @area.update_attributes(params[:area])
|
61
|
+
format.html { redirect_to @area, :notice => "Area updated" }
|
62
|
+
else
|
63
|
+
flash.now[:alert] = I18n.t(:update_failed, :scope => [:authentasaurus, :messages, :areas])
|
64
|
+
format.html { render :edit }
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def destroy
|
70
|
+
@area = Area.find params[:id]
|
71
|
+
@area.destroy
|
72
|
+
|
73
|
+
respond_to do |format|
|
74
|
+
format.html { redirect_to :action=>:index }
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
69
78
|
end
|
@@ -1,71 +1,79 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
1
|
+
module Authentasaurus::GroupsController
|
2
|
+
def self.included(base) # :nodoc:
|
3
|
+
base.send :extend, ClassMethods
|
4
|
+
base.send :include, InstanceMethods
|
5
|
+
end
|
6
|
+
|
7
|
+
module ClassMethods
|
8
|
+
end
|
9
|
+
|
10
|
+
module InstanceMethods
|
11
|
+
def index
|
12
|
+
@groups = Group.find :all
|
13
|
+
|
14
|
+
respond_to do |format|
|
15
|
+
format.html
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def show
|
20
|
+
@group = Group.find params[:id]
|
21
|
+
|
22
|
+
respond_to do |format|
|
23
|
+
format.html
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def new
|
28
|
+
@group = Group.new
|
29
|
+
|
30
|
+
respond_to do |format|
|
31
|
+
format.html
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def create
|
36
|
+
@group = Group.new params[:group]
|
37
|
+
|
38
|
+
respond_to do |format|
|
39
|
+
if @group.save
|
40
|
+
format.html { redirect_to :action=>:index, :notice => "Group created" }
|
41
|
+
else
|
42
|
+
flash.now[:alert] = I18n.t(:create_failed, :scope => [:authentasaurus, :messages, :groups])
|
43
|
+
format.html { render :new }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def edit
|
49
|
+
@group = Group.find params[:id]
|
50
|
+
|
51
|
+
respond_to do |format|
|
52
|
+
format.html
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def update
|
57
|
+
@group = Group.find params[:id]
|
58
|
+
|
59
|
+
respond_to do |format|
|
60
|
+
if @group.update_attributes(params[:group])
|
61
|
+
format.html { redirect_to @group, :notice => "Group updated" }
|
62
|
+
else
|
63
|
+
flash.now[:alert] = I18n.t(:update_failed, :scope => [:authentasaurus, :messages, :groups])
|
64
|
+
format.html { render :edit }
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
def destroy
|
71
|
+
@group = Group.find params[:id]
|
72
|
+
@group.destroy
|
73
|
+
|
74
|
+
respond_to do |format|
|
75
|
+
format.html { redirect_to :action=>:index }
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
71
79
|
end
|
@@ -1,8 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
module Authentasaurus::Models::Area
|
2
|
+
def self.included(base) # :nodoc:
|
3
|
+
base.send :extend, ClassMethods
|
4
|
+
base.send :include, InstanceMethods
|
5
|
+
|
6
|
+
base.send :has_many, :permissions, :dependent => :destroy
|
7
|
+
base.send :has_many, :groups, :through => :permissions
|
8
|
+
|
9
|
+
base.send :validates_presence_of, :name
|
10
|
+
end
|
7
11
|
|
12
|
+
module ClassMethods
|
13
|
+
end
|
14
|
+
|
15
|
+
module InstanceMethods
|
16
|
+
end
|
8
17
|
end
|