faalis 0.25.1 → 0.26.0
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/faalis/{dashboard/angular.js → angular-manifest.js} +5 -3
- data/app/assets/javascripts/faalis/dashboard/application.js.erb +1 -0
- data/app/assets/stylesheets/faalis/base.css.scss +5 -4
- data/app/assets/stylesheets/faalis/dashboard/dashboard.css.scss +150 -138
- data/app/controllers/faalis/api_controller.rb +104 -101
- data/lib/faalis/engine.rb +6 -8
- data/lib/faalis/version.rb +1 -1
- data/lib/faalis/workflows/base.rb +25 -24
- metadata +17 -7
- data/app/assets/javascripts/faalis/dashboard/lib/angular-animate.js +0 -1226
- data/app/assets/javascripts/faalis/dashboard/lib/angular-resource.js +0 -578
- data/app/assets/javascripts/faalis/dashboard/lib/angular-route.js +0 -880
- data/app/assets/javascripts/faalis/dashboard/lib/angular.js +0 -20031
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 43f7695840d9c906e726d44dc7e73ab16f288c67
|
|
4
|
+
data.tar.gz: 9bf0ceb04ac7ea42f538686101dd9aba081f6364
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3ab3a88bbd4d6cf47859004bef759b84926402b97f74c5fc47bff8fdca298d455844a2666f0e5acffc73702982fea0e0010a0f074bb8e7a6c833a46a167e37cb
|
|
7
|
+
data.tar.gz: 1da96282c9542e22dcd07db980457d1c3c8009d617e2a332d1341a01aca7c3b0307d3603c329a4b4f2b47c9af4967494849c3528d5f75f63d2102151bd97bd49
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
//= require jquery
|
|
3
3
|
//= require jquery_ujs
|
|
4
4
|
//= require foundation
|
|
5
|
-
//= require
|
|
6
|
-
//= require
|
|
7
|
-
//= require
|
|
5
|
+
//= require angular
|
|
6
|
+
//= require angular-animate
|
|
7
|
+
//= require angular-resource
|
|
8
|
+
//= require angular-route
|
|
9
|
+
//= require angular-sanitize
|
|
8
10
|
//= require faalis/dashboard/lib/angular-gettext
|
|
9
11
|
//= require faalis/dashboard/lib/lodash.underscore
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
|
11
11
|
// about supported directives.
|
|
12
12
|
//
|
|
13
|
+
//= require faalis/angular-manifest
|
|
13
14
|
//= require_tree ./lib
|
|
14
15
|
//= require faalis/dashboard/init
|
|
15
16
|
//= require faalis/dashboard/app
|
|
@@ -16,78 +16,78 @@ body {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
header {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
li {
|
|
29
|
-
display: inline;
|
|
30
|
-
h1 {
|
|
31
|
-
font-size: 1.5em;
|
|
32
|
-
display: inline-block;
|
|
33
|
-
font-weight: 300;
|
|
34
|
-
color: $darkgray;
|
|
35
|
-
}
|
|
36
|
-
.search {
|
|
37
|
-
display: inline-block;
|
|
38
|
-
padding: 0 10px;
|
|
39
|
-
input {
|
|
40
|
-
display: inline-block;
|
|
41
|
-
border-radius: 4px;
|
|
42
|
-
border-color: $lightergray;
|
|
43
|
-
box-shadow: none;
|
|
44
|
-
padding: 0 0.5em;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
19
|
+
background: white;
|
|
20
|
+
border-bottom: 1px solid $orange;
|
|
21
|
+
position: fixed;
|
|
22
|
+
z-index: 1000;
|
|
23
|
+
height: $header-height;
|
|
24
|
+
width: 100%;
|
|
25
|
+
ul {
|
|
26
|
+
list-style: none;
|
|
49
27
|
|
|
50
|
-
nav {
|
|
51
|
-
ul {
|
|
52
28
|
li {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
29
|
+
display: inline;
|
|
30
|
+
h1 {
|
|
31
|
+
font-size: 1.5em;
|
|
32
|
+
display: inline-block;
|
|
33
|
+
font-weight: 300;
|
|
34
|
+
color: $darkgray;
|
|
35
|
+
}
|
|
36
|
+
.search {
|
|
37
|
+
display: inline-block;
|
|
38
|
+
padding: 0 10px;
|
|
39
|
+
input {
|
|
40
|
+
display: inline-block;
|
|
41
|
+
border-radius: 4px;
|
|
42
|
+
border-color: $lightergray;
|
|
43
|
+
box-shadow: none;
|
|
44
|
+
padding: 0 0.5em;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
67
49
|
|
|
50
|
+
nav {
|
|
51
|
+
ul {
|
|
52
|
+
li {
|
|
53
|
+
display: inline-block;
|
|
54
|
+
padding: (($header-height / 4) - 3px) 20px 0 ;
|
|
55
|
+
height: $header-height;
|
|
56
|
+
margin: 0 5px;
|
|
57
|
+
|
|
58
|
+
&:not(.staticitem):hover {
|
|
59
|
+
border-bottom: 5px solid $alizarin;
|
|
60
|
+
}
|
|
61
|
+
span {
|
|
62
|
+
vertical-align: middle;
|
|
63
|
+
color: $darkgray;
|
|
64
|
+
cursor:pointer;
|
|
65
|
+
font-size: 1.2em;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
}
|
|
68
69
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.subnav {
|
|
73
|
+
background: $alizarin;
|
|
74
|
+
position: fixed;
|
|
75
|
+
top: $header-height;
|
|
76
|
+
padding: 10px 20px;
|
|
77
|
+
border-radius: 0 0 5px 5px;
|
|
78
|
+
min-width: 100px;
|
|
79
|
+
color: white;
|
|
80
|
+
ul li {
|
|
81
|
+
padding: 4px 10px;
|
|
82
|
+
a {
|
|
83
|
+
color: lighten($lightergray, 5%);
|
|
84
|
+
text-shadow: 0 1px 1px $darkgray;
|
|
85
|
+
&:hover {
|
|
86
|
+
color: white;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
88
89
|
}
|
|
89
|
-
|
|
90
|
-
}
|
|
90
|
+
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
|
|
@@ -126,105 +126,117 @@ ul{
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
&.whitewidget {
|
|
130
|
+
background: white;
|
|
131
|
+
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
fieldset {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
135
|
+
label {
|
|
136
|
+
padding: 0px 0px 5px 0px;
|
|
137
|
+
}
|
|
138
|
+
.permissions {
|
|
139
|
+
margin: 0 10px;
|
|
140
|
+
|
|
141
|
+
.field {
|
|
142
|
+
height: 16em;
|
|
143
|
+
border: 1px solid $lightergray;
|
|
144
|
+
color: $darkgray;
|
|
145
|
+
|
|
146
|
+
padding: 5px 10px;
|
|
147
|
+
overflow-y: auto;
|
|
148
|
+
ul {
|
|
149
|
+
list-style: none;
|
|
150
|
+
li {
|
|
151
|
+
cursor: pointer;
|
|
152
|
+
i.green-text {
|
|
153
|
+
color: $emerald;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
156
157
|
}
|
|
157
|
-
|
|
158
|
-
}
|
|
158
|
+
}
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
.dashboard-body {
|
|
162
|
-
|
|
162
|
+
padding-top: $header-height + 20px;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
.buttons-header {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
span {
|
|
167
|
+
margin: 5px 5px 5px;
|
|
168
|
+
}
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
.input-error {
|
|
172
|
-
|
|
172
|
+
border-color: $alizarin !important;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
// Tabs --------------------------------------------------------
|
|
176
176
|
@mixin active-tab ($color){
|
|
177
|
-
|
|
177
|
+
border-bottom: $tab-bottom-border solid $color;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
.tabs {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
li {
|
|
194
|
-
color: $darkgray;
|
|
195
|
-
display: inline-block;
|
|
196
|
-
position: relative;
|
|
197
|
-
padding: 10px 20px;
|
|
198
|
-
cursor: pointer;
|
|
199
|
-
height: $tabs-height - 1px;
|
|
200
|
-
|
|
201
|
-
&.active {
|
|
202
|
-
&.tab1{
|
|
203
|
-
@include active-tab($emerald);
|
|
204
|
-
}
|
|
205
|
-
&.tab2{
|
|
206
|
-
@include active-tab($alizarin);
|
|
207
|
-
}
|
|
208
|
-
&.tab3{
|
|
209
|
-
@include active-tab($peter_river);
|
|
210
|
-
}
|
|
211
|
-
&.tab4{
|
|
212
|
-
@include active-tab($orange);
|
|
213
|
-
}
|
|
181
|
+
width: 100%;
|
|
182
|
+
background: #fff;
|
|
183
|
+
border-radius: 4px;
|
|
184
|
+
border: 1px solid $lightergray;
|
|
185
|
+
border-bottom: $tab-bottom-border solid $lightgray;
|
|
186
|
+
padding: 0 10px;
|
|
187
|
+
font-size: 14px;
|
|
188
|
+
height: $tabs-height;
|
|
189
|
+
color: $lightergray;
|
|
190
|
+
ul {
|
|
191
|
+
list-style: none;
|
|
214
192
|
|
|
193
|
+
li {
|
|
194
|
+
color: $darkgray;
|
|
195
|
+
display: inline-block;
|
|
196
|
+
position: relative;
|
|
197
|
+
padding: 10px 20px;
|
|
198
|
+
cursor: pointer;
|
|
199
|
+
height: $tabs-height - 1px;
|
|
200
|
+
|
|
201
|
+
&.active {
|
|
202
|
+
&.tab1{
|
|
203
|
+
@include active-tab($emerald);
|
|
204
|
+
}
|
|
205
|
+
&.tab2{
|
|
206
|
+
@include active-tab($alizarin);
|
|
207
|
+
}
|
|
208
|
+
&.tab3{
|
|
209
|
+
@include active-tab($peter_river);
|
|
210
|
+
}
|
|
211
|
+
&.tab4{
|
|
212
|
+
@include active-tab($orange);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
}
|
|
215
216
|
}
|
|
216
|
-
|
|
217
|
-
}
|
|
217
|
+
}
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
|
|
221
221
|
.filter_box {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
222
|
+
fieldset {
|
|
223
|
+
background: $peter_river;
|
|
224
|
+
border-color: darken($peter_river, 5%);
|
|
225
|
+
}
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
.nonestyle {
|
|
229
229
|
list-style: none;
|
|
230
230
|
}
|
|
231
|
+
|
|
232
|
+
.fancy_table {
|
|
233
|
+
border: 1px solid $lightergray;
|
|
234
|
+
padding: 0px 0px !important;
|
|
235
|
+
thead {
|
|
236
|
+
tr {
|
|
237
|
+
th {
|
|
238
|
+
padding: 0;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
@@ -16,129 +16,132 @@
|
|
|
16
16
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
17
17
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
18
18
|
# -----------------------------------------------------------------------------
|
|
19
|
-
require_dependency
|
|
19
|
+
require_dependency 'faalis/api_controller'
|
|
20
20
|
|
|
21
|
+
module Faalis
|
|
22
|
+
# This class is the base class of all API controllers in any **Faalis**
|
|
23
|
+
# host applications. Each host Rails application should have an `APIController`
|
|
24
|
+
# which inherit from this class.
|
|
25
|
+
class APIController < Faalis::ApplicationController
|
|
21
26
|
|
|
22
|
-
#
|
|
23
|
-
|
|
24
|
-
# which inherit from this class.
|
|
25
|
-
class Faalis::APIController < Faalis::ApplicationController
|
|
27
|
+
# Only support `json` format
|
|
28
|
+
respond_to :json
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
# Authenticate user before any action take place
|
|
31
|
+
before_filter :authenticate_filter
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
# Check for any presence of filtering query, In querystring and load
|
|
34
|
+
# resource using them
|
|
35
|
+
before_filter :load_resource_by_query, :only => [:index]
|
|
31
36
|
|
|
32
|
-
|
|
33
|
-
before_filter :authenticate_filter
|
|
37
|
+
protect_from_forgery
|
|
34
38
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
before_filter :load_resource_by_query, :only => [:index]
|
|
39
|
+
# Set csrf cookie after any action
|
|
40
|
+
after_filter :set_csrf_cookie_for_ng
|
|
38
41
|
|
|
42
|
+
# Rescue from any access denied exception raised from cancan and
|
|
43
|
+
# returns a useful error message in json
|
|
44
|
+
rescue_from CanCan::AccessDenied do |exception|
|
|
45
|
+
render :status => 403, :json => {
|
|
46
|
+
:error => _('You don\'t have access to this page'),
|
|
47
|
+
:orig_msg => exception.message,
|
|
48
|
+
:action => exception.action
|
|
49
|
+
}
|
|
50
|
+
end
|
|
39
51
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
after_filter :set_csrf_cookie_for_ng
|
|
44
|
-
|
|
45
|
-
# Rescue from any access denied exception raised from cancan and
|
|
46
|
-
# returns a useful error message in json
|
|
47
|
-
rescue_from CanCan::AccessDenied do |exception|
|
|
48
|
-
|
|
49
|
-
render :status => 403, :json => {
|
|
50
|
-
:error => _("You don't have access to this page"),
|
|
51
|
-
:orig_msg => exception.message,
|
|
52
|
-
:action => exception.action,
|
|
53
|
-
}
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def set_csrf_cookie_for_ng
|
|
57
|
-
cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
# User authentication for API services take place here. By default
|
|
61
|
-
# **Faalis** uses the authentication method of **Devise** to authenticate
|
|
62
|
-
# access to API service.
|
|
63
|
-
#
|
|
64
|
-
# If you want to change authentication method ? just override this method
|
|
65
|
-
# in you **APIController**
|
|
66
|
-
def authenticate_filter
|
|
67
|
-
authenticate_user!
|
|
68
|
-
end
|
|
52
|
+
def set_csrf_cookie_for_ng
|
|
53
|
+
cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?
|
|
54
|
+
end
|
|
69
55
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
#
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
# which `querytype` is string that specify the query type scope
|
|
80
|
-
# to use in model. For example these is a query type scope called
|
|
81
|
-
# `gt` which mean the mentioned field should be greater than the
|
|
82
|
-
# value
|
|
83
|
-
field, query_type = key.split("__")
|
|
84
|
-
|
|
85
|
-
if allowed_fields.include? field
|
|
86
|
-
# If field name is in the allowed list
|
|
87
|
-
# If no query type specified we will use assignment scope.
|
|
88
|
-
if query_type.nil?
|
|
89
|
-
query_type = "assignment"
|
|
90
|
-
end
|
|
56
|
+
# User authentication for API services take place here. By default
|
|
57
|
+
# **Faalis** uses the authentication method of **Devise** to authenticate
|
|
58
|
+
# access to API service.
|
|
59
|
+
#
|
|
60
|
+
# If you want to change authentication method ? just override this method
|
|
61
|
+
# in you **APIController**
|
|
62
|
+
def authenticate_filter
|
|
63
|
+
authenticate_user!
|
|
64
|
+
end
|
|
91
65
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
66
|
+
# Load resource by using parameters specified in querystring.
|
|
67
|
+
def load_resource_by_query
|
|
68
|
+
# If any query string parameter provided and allow fields specified
|
|
69
|
+
if !request.query_parameters.empty? && !allowed_fields.empty?
|
|
70
|
+
|
|
71
|
+
logger.info ('Load resource by query parameters')
|
|
72
|
+
# Iterate over parameters in query string
|
|
73
|
+
request.query_parameters.each do |key, value|
|
|
74
|
+
# each key can be like filename[__querytype]=value
|
|
75
|
+
# which `querytype` is string that specify the query type scope
|
|
76
|
+
# to use in model. For example these is a query type scope called
|
|
77
|
+
# `gt` which mean the mentioned field should be greater than the
|
|
78
|
+
# value
|
|
79
|
+
field, query_type = key.split('__')
|
|
80
|
+
|
|
81
|
+
if allowed_fields.include? field
|
|
82
|
+
# If field name is in the allowed list
|
|
83
|
+
# If no query type specified we will use assignment scope.
|
|
84
|
+
query_type = 'assignment' if query_type.nil?
|
|
85
|
+
|
|
86
|
+
# If model have an scope with the "#{query_type}_query" name.
|
|
87
|
+
# Otherwise skip
|
|
88
|
+
if model_class.respond_to? "#{query_type}_query"
|
|
89
|
+
|
|
90
|
+
# If resource already loaded. If there was a instnace variable
|
|
91
|
+
# with the plural name of the resource exists then resource
|
|
92
|
+
# already loaded and we should chain new conditions
|
|
93
|
+
if instance_variable_defined? "@#{controller_name}"
|
|
94
|
+
var = instance_variable_get("@#{controller_name}")
|
|
95
|
+
var.send("#{query_type}_query".to_sym, field, value)
|
|
96
|
+
else
|
|
97
|
+
# Resource did not loaded we make first query
|
|
98
|
+
# (without touching database) and set the corresponding
|
|
99
|
+
# instance variables
|
|
100
|
+
relation_object = model_class.send("#{query_type}_query".to_sym,
|
|
101
|
+
field, value)
|
|
102
|
+
instance_variable_set("@#{controller_name}", relation_object)
|
|
103
|
+
end
|
|
95
104
|
|
|
96
|
-
# If resource already loaded. If there was a instnace variable
|
|
97
|
-
# with the plural name of the resource exists then resource
|
|
98
|
-
# already loaded and we should chain new conditions
|
|
99
|
-
if instance_variable_defined? "@#{controller_name}"
|
|
100
|
-
instance_variable_get("@#{controller_name}").send("#{query_type}_query".to_sym, field, value)
|
|
101
105
|
else
|
|
102
|
-
|
|
103
|
-
# (without touching database) and set the corresponding
|
|
104
|
-
# instance variables
|
|
105
|
-
relation_object = model_class.send("#{query_type}_query".to_sym, field, value)
|
|
106
|
-
instance_variable_set("@#{controller_name}", relation_object)
|
|
106
|
+
logger.info "There is no `#{query_type}_query` in `#{model_class.to_s}` model."
|
|
107
107
|
end
|
|
108
|
-
|
|
109
108
|
else
|
|
110
|
-
logger.
|
|
109
|
+
logger.warn "`#{field}` in not in allowed list for `#{self.class.to_s}`."
|
|
111
110
|
end
|
|
112
|
-
else
|
|
113
|
-
logger.warn "`#{field}` in not in allowed list for `#{self.class.to_s}`."
|
|
114
111
|
end
|
|
112
|
+
else
|
|
113
|
+
logger.info('Load resource using `load_resource`')
|
|
114
|
+
#self.class.load_resource
|
|
115
115
|
end
|
|
116
|
-
else
|
|
117
|
-
logger.info("Load resource using `load_resource`")
|
|
118
|
-
#self.class.load_resource
|
|
119
116
|
end
|
|
120
|
-
end
|
|
121
117
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
118
|
+
# This attribute holds the allowed fileds which we will allow for
|
|
119
|
+
# making query
|
|
120
|
+
def allowed_fields
|
|
121
|
+
return allowed_query_on if self.respond_to?(:allowed_query_on, true)
|
|
122
|
+
@allowed_fields || []
|
|
123
|
+
end
|
|
126
124
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
125
|
+
# Using this query you can activate the query loading system
|
|
126
|
+
# and specify fields which you want to use in query loading
|
|
127
|
+
def self.allow_query_on(*args)
|
|
128
|
+
#instance_variable_set(:@allowed_fields, args.to_a.collect { |x| x.to_s })
|
|
129
|
+
define_method :allowed_query_on do
|
|
130
|
+
args.to_a.collect { |x| x.to_s }
|
|
131
|
+
end
|
|
132
|
+
private :allowed_query_on
|
|
133
|
+
end
|
|
132
134
|
|
|
133
|
-
|
|
135
|
+
protected
|
|
134
136
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
# Model class related to this controller.
|
|
138
|
+
def model_class
|
|
139
|
+
controller_name.singularize.classify.constantize
|
|
140
|
+
end
|
|
139
141
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
142
|
+
def verified_request?
|
|
143
|
+
super || form_authenticity_token == request.headers['X-XSRF-TOKEN']
|
|
144
|
+
end
|
|
143
145
|
|
|
146
|
+
end
|
|
144
147
|
end
|