admin_engine 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -3
- data/app/controllers/application_controller.rb +1 -1
- data/app/models/account.rb +5 -0
- data/db/migrate/20121029000000_create_admins.rb +2 -2
- data/lib/admin_engine/version.rb +1 -1
- data/lib/admin_engine.rb +1 -1
- metadata +55 -55
- data/app/models/user.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 791cf1c1288b7fafc5563b84e481c4c255025aec
|
4
|
+
data.tar.gz: 48e0b35192b52905ba5e448223e16f48b19ffe6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 509841a70ef6862acbb759da0bec79c39e3d0f017fd91343b5a5037f4a92309e6664b2cd0ccb5ef75564be627242863679e13808910f2de604660edbd2990916
|
7
|
+
data.tar.gz: 1a3e7389ee6de4d1653a7facb7a47b7825f8048bc3ce74125eb7cf94829404dc231177d3bc2dc23da878e4620550e20779b033d359fe7391df1064075e9a75ae
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# AdminEngine
|
2
|
+
## Usage
|
2
3
|
|
3
4
|
Install the database migration to create an admins table.
|
4
5
|
|
@@ -8,20 +9,20 @@ Run the database migration.
|
|
8
9
|
|
9
10
|
bundle exec rake db:migrate
|
10
11
|
|
11
|
-
Use a before_filter for actions that require the logged in
|
12
|
+
Use a before_filter for actions that require the logged in account to be admin.
|
12
13
|
|
13
14
|
before_filter :authorize_admin
|
14
15
|
|
15
16
|
Visit http://localhost:3000/admin
|
16
17
|
|
17
|
-
If the logged in
|
18
|
+
If the logged in account is not an admin, you will see the following:
|
18
19
|
|
19
20
|
### Unknown action
|
20
21
|
|
21
22
|
AbstractController::ActionNotFound
|
22
23
|
<br>
|
23
24
|
<hr>
|
24
|
-
Make the logged in
|
25
|
+
Make the logged in account an admin by adding an entry in the admins table.
|
25
26
|
|
26
27
|
Now you will see the following:
|
27
28
|
|
@@ -29,3 +30,18 @@ Now you will see the following:
|
|
29
30
|
|
30
31
|
Customize this page by implementing views/admin/home.
|
31
32
|
<hr>
|
33
|
+
## Development
|
34
|
+
### Prepare the "dummy" app
|
35
|
+
pushd spec/dummy
|
36
|
+
rake user_authentication:install:migrations
|
37
|
+
rake admin_engine:install:migrations
|
38
|
+
rake db:drop
|
39
|
+
rake db:create
|
40
|
+
rake db:migrate
|
41
|
+
rake db:test:prepare
|
42
|
+
popd
|
43
|
+
|
44
|
+
### Run specs
|
45
|
+
rspec
|
46
|
+
|
47
|
+
|
@@ -1,9 +1,9 @@
|
|
1
1
|
class CreateAdmins < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :admins do |t|
|
4
|
-
t.references :
|
4
|
+
t.references :account, :null => false
|
5
5
|
end
|
6
6
|
|
7
|
-
add_index :admins, [:
|
7
|
+
add_index :admins, [:account_id], :unique => true
|
8
8
|
end
|
9
9
|
end
|
data/lib/admin_engine/version.rb
CHANGED
data/lib/admin_engine.rb
CHANGED
@@ -7,7 +7,7 @@ module AdminEngine
|
|
7
7
|
|
8
8
|
config.after_initialize do
|
9
9
|
require File.expand_path('../../app/controllers/application_controller', __FILE__)
|
10
|
-
require File.expand_path('../../app/models/
|
10
|
+
require File.expand_path('../../app/models/account', __FILE__)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
metadata
CHANGED
@@ -1,153 +1,153 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: admin_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sujoy Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: haml
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.0
|
19
|
+
version: '4.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.0
|
26
|
+
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.1
|
33
|
+
version: '4.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.1
|
40
|
+
version: '4.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: user_authentication
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0
|
47
|
+
version: '1.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0
|
54
|
+
version: '1.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: capybara
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '4
|
61
|
+
version: '2.4'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '4
|
68
|
+
version: '2.4'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: factory_girl_rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
75
|
+
version: '4.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
82
|
+
version: '4.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: rspec-rails
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - ~>
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: '3.1'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - ~>
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: '3.1'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name: specstar-
|
98
|
+
name: specstar-controllers
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - ~>
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.
|
103
|
+
version: '0.1'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - ~>
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.
|
110
|
+
version: '0.1'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name: specstar-
|
112
|
+
name: specstar-models
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - ~>
|
115
|
+
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.
|
117
|
+
version: '0.2'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - ~>
|
122
|
+
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0.
|
124
|
+
version: '0.2'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: specstar-support-random
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
131
|
+
version: '0.1'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
138
|
+
version: '0.1'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: sqlite3
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
description: A rails engine for adding admin functionality.
|
@@ -157,19 +157,19 @@ executables: []
|
|
157
157
|
extensions: []
|
158
158
|
extra_rdoc_files: []
|
159
159
|
files:
|
160
|
+
- MIT-LICENSE
|
161
|
+
- README.md
|
162
|
+
- Rakefile
|
160
163
|
- app/controllers/admin_controller.rb
|
161
164
|
- app/controllers/application_controller.rb
|
165
|
+
- app/models/account.rb
|
162
166
|
- app/models/admin.rb
|
163
|
-
- app/models/user.rb
|
164
167
|
- app/views/admin/home.html.haml
|
165
168
|
- config/routes.rb
|
166
169
|
- db/migrate/20121029000000_create_admins.rb
|
167
|
-
- lib/admin_engine/version.rb
|
168
170
|
- lib/admin_engine.rb
|
171
|
+
- lib/admin_engine/version.rb
|
169
172
|
- lib/tasks/admin_engine_tasks.rake
|
170
|
-
- MIT-LICENSE
|
171
|
-
- Rakefile
|
172
|
-
- README.md
|
173
173
|
homepage: http://www.github.com/sujoyg/admin_engine
|
174
174
|
licenses:
|
175
175
|
- MIT
|
@@ -180,17 +180,17 @@ require_paths:
|
|
180
180
|
- lib
|
181
181
|
required_ruby_version: !ruby/object:Gem::Requirement
|
182
182
|
requirements:
|
183
|
-
- -
|
183
|
+
- - ">="
|
184
184
|
- !ruby/object:Gem::Version
|
185
185
|
version: '0'
|
186
186
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
187
|
requirements:
|
188
|
-
- -
|
188
|
+
- - ">="
|
189
189
|
- !ruby/object:Gem::Version
|
190
190
|
version: '0'
|
191
191
|
requirements: []
|
192
192
|
rubyforge_project:
|
193
|
-
rubygems_version: 2.
|
193
|
+
rubygems_version: 2.2.2
|
194
194
|
signing_key:
|
195
195
|
specification_version: 4
|
196
196
|
summary: A rails engine for adding admin functionality.
|