sortable_skima 0.2.0.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +192 -0
- data/app/assets/javascripts/jquery-ui.min.js +12 -0
- data/app/assets/javascripts/jquery.ba-bbq.js +1137 -0
- data/app/assets/javascripts/skima-sortable-tables_2_0_10.js +450 -0
- data/app/assets/stylesheets/images/animated-overlay.gif +0 -0
- data/app/assets/stylesheets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/stylesheets/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/stylesheets/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/app/assets/stylesheets/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/stylesheets/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/app/assets/stylesheets/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/app/assets/stylesheets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/app/assets/stylesheets/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/app/assets/stylesheets/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/stylesheets/images/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/stylesheets/images/ui-icons_454545_256x240.png +0 -0
- data/app/assets/stylesheets/images/ui-icons_888888_256x240.png +0 -0
- data/app/assets/stylesheets/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/stylesheets/jquery-ui.css +1183 -0
- data/app/controllers/sortables_controller.rb +75 -0
- data/app/models/sortable.rb +82 -0
- data/config/routes.rb +5 -0
- data/doc/Backtrace.html +493 -0
- data/doc/README_rdoc.html +329 -0
- data/doc/SortableHelper.html +364 -0
- data/doc/SortableSkima.html +343 -0
- data/doc/SortableSkima/Engine.html +131 -0
- data/doc/created.rid +7 -0
- data/doc/images/add.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +347 -0
- data/doc/js/darkfish.js +155 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +543 -0
- data/doc/sortable_parser.html +78 -0
- data/doc/table_of_contents.html +114 -0
- data/lib/sortable_skima.rb +122 -0
- data/lib/sortable_skima/active_record.rb +36 -0
- data/lib/sortable_skima/backtrace.rb +53 -0
- data/lib/sortable_skima/engine.rb +63 -0
- data/lib/sortable_skima/helpers/sortable_helper.rb +188 -0
- metadata +142 -0
@@ -0,0 +1,75 @@
|
|
1
|
+
class SortablesController < ApplicationController #BaseController
|
2
|
+
|
3
|
+
def data_query
|
4
|
+
#puts "==================================="
|
5
|
+
#puts "MAPPINGS: #{Devise.mappings.to_yaml}"
|
6
|
+
#puts "====================================="
|
7
|
+
srtbl = Sortable.find(params[:query])
|
8
|
+
backtrace = Backtrace.for_token(srtbl.token, current_user || current_admin)
|
9
|
+
|
10
|
+
filters = params[:filters]
|
11
|
+
orders = params[:order_by]
|
12
|
+
page = params[:page]
|
13
|
+
unless srtbl.options[:disable_backtrace]
|
14
|
+
filters = backtrace.get_filters if filters.blank?
|
15
|
+
orders = backtrace.get_order if orders.blank?
|
16
|
+
page = backtrace.get_page if page.blank?
|
17
|
+
end
|
18
|
+
orders = srtbl.options[:default_order] if orders.blank?
|
19
|
+
|
20
|
+
backtrace.update_sortables filters, orders, page
|
21
|
+
|
22
|
+
query = eval "#{srtbl.base_query}#{srtbl.external_filters}"
|
23
|
+
|
24
|
+
query = SortableSkima.attach_filters query, filters, srtbl
|
25
|
+
|
26
|
+
query, order_for_client = SortableSkima.attach_orders query, orders, srtbl
|
27
|
+
|
28
|
+
if srtbl.options[:paginate] && page
|
29
|
+
query = query.paginate(:page => page, :per_page => (params[:per_page] || 10))
|
30
|
+
pag_data = view_context.will_paginate( query)
|
31
|
+
end
|
32
|
+
|
33
|
+
#set filters to first value if there is no backtrace
|
34
|
+
if srtbl.options[:disable_backtrace]
|
35
|
+
filters ||= {}
|
36
|
+
srtbl.filters.each_index do |f_id|
|
37
|
+
f_id_s = f_id.to_s
|
38
|
+
filters[f_id_s] = 0 if filters[f_id_s].nil?
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
unless query.kind_of? ActiveRecord::Relation || query.kind_of?(Array)
|
43
|
+
query = query.all
|
44
|
+
end
|
45
|
+
|
46
|
+
old_json_setting = ActiveRecord::Base.include_root_in_json
|
47
|
+
ActiveRecord::Base.include_root_in_json = false
|
48
|
+
|
49
|
+
render :json => {:pagination=>pag_data,
|
50
|
+
:filters=>filters,
|
51
|
+
:cur_order=>order_for_client,
|
52
|
+
:rows_data=>query.map{|model|
|
53
|
+
out = {}
|
54
|
+
srtbl.columns_queries.each_with_index do |col,i|
|
55
|
+
out[i] = {:val=>model.external_eval( col[:display_method],self, view_context)} #[ef]
|
56
|
+
out[i][:path] = eval(col[:path_method]) if col[:path_method]
|
57
|
+
out[i][:field_name] = col[:sort_field]
|
58
|
+
out[i][:no_display] = true if col[:no_display]
|
59
|
+
end
|
60
|
+
out
|
61
|
+
}}
|
62
|
+
Backtrace.clear_old_records
|
63
|
+
ActiveRecord::Base.include_root_in_json = old_json_setting
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
class ActiveRecord::Base
|
71
|
+
def external_eval arg, controller_context, view_context
|
72
|
+
eval arg
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
@@ -0,0 +1,82 @@
|
|
1
|
+
class Sortable < ActiveRecord::Base
|
2
|
+
serialize :query
|
3
|
+
|
4
|
+
:init_query
|
5
|
+
|
6
|
+
def base_query
|
7
|
+
safe_query[:base_query]
|
8
|
+
end
|
9
|
+
|
10
|
+
def columns_queries
|
11
|
+
safe_query[:columns_queries]
|
12
|
+
end
|
13
|
+
|
14
|
+
def filters
|
15
|
+
safe_query[:filters]
|
16
|
+
end
|
17
|
+
|
18
|
+
def token
|
19
|
+
safe_query[:token]
|
20
|
+
end
|
21
|
+
|
22
|
+
def options
|
23
|
+
safe_query[:options]
|
24
|
+
end
|
25
|
+
|
26
|
+
def external_filters
|
27
|
+
safe_query[:external_filters]
|
28
|
+
end
|
29
|
+
|
30
|
+
def base_query=(val)
|
31
|
+
safe_query[:token]<<"_#{val}".hash.to_s(32)
|
32
|
+
safe_query[:base_query] = val
|
33
|
+
end
|
34
|
+
|
35
|
+
def columns_queries=(val)
|
36
|
+
safe_query[:columns_queries]=val
|
37
|
+
end
|
38
|
+
|
39
|
+
def filters=(val)
|
40
|
+
safe_query[:filters]=val
|
41
|
+
end
|
42
|
+
|
43
|
+
def token=(val)
|
44
|
+
safe_query[:token]=val
|
45
|
+
end
|
46
|
+
|
47
|
+
def options=(val)
|
48
|
+
safe_query[:options]=val
|
49
|
+
end
|
50
|
+
|
51
|
+
def external_filters=(val)
|
52
|
+
safe_query[:external_filters]=val
|
53
|
+
end
|
54
|
+
|
55
|
+
def add_option opt_key, opt_value
|
56
|
+
safe_query[:token]<<"_#{opt_key} #{opt_value}".hash.to_s(32)
|
57
|
+
safe_query[:options][opt_key] = opt_value
|
58
|
+
end
|
59
|
+
|
60
|
+
def add_filter new_filter
|
61
|
+
safe_query[:token]<<"_#{new_filter[:column_name]}".hash.to_s(32)
|
62
|
+
safe_query[:filters]<<(new_filter)
|
63
|
+
end
|
64
|
+
|
65
|
+
def add_column sort_field, display_method, path_method = nil
|
66
|
+
logger.debug "ADDING COLUMN: #{sort_field}"
|
67
|
+
display_method = sort_field if display_method.blank?
|
68
|
+
safe_query[:columns_queries]<<{:sort_field=>sort_field,:display_method=>display_method,:path_method=>path_method}
|
69
|
+
safe_query[:token]<<"_#{sort_field}".hash.to_s(32)
|
70
|
+
return safe_query[:columns_queries].size() - 1
|
71
|
+
end
|
72
|
+
|
73
|
+
def safe_query
|
74
|
+
self.query = {:base_query=>'',:columns_queries=>[],:filters=>[],:token=>'',:options=>{}} if self.query.nil?
|
75
|
+
self.query
|
76
|
+
end
|
77
|
+
|
78
|
+
private
|
79
|
+
def init_query
|
80
|
+
#query = {:base_query=>'',:columns_queries=>[]}
|
81
|
+
end
|
82
|
+
end
|
data/config/routes.rb
ADDED
data/doc/Backtrace.html
ADDED
@@ -0,0 +1,493 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class Backtrace - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "./";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="./index.html">Home</a>
|
28
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/sortable_skima/backtrace.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link">ActiveRecord::Base
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<nav id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
<li><a href="#method-c-clear_old_records">::clear_old_records</a>
|
74
|
+
|
75
|
+
<li><a href="#method-c-for_token">::for_token</a>
|
76
|
+
|
77
|
+
<li><a href="#method-i-get_filters">#get_filters</a>
|
78
|
+
|
79
|
+
<li><a href="#method-i-get_order">#get_order</a>
|
80
|
+
|
81
|
+
<li><a href="#method-i-get_page">#get_page</a>
|
82
|
+
|
83
|
+
<li><a href="#method-i-parsed_sortables">#parsed_sortables</a>
|
84
|
+
|
85
|
+
<li><a href="#method-i-set_filters">#set_filters</a>
|
86
|
+
|
87
|
+
<li><a href="#method-i-set_order">#set_order</a>
|
88
|
+
|
89
|
+
<li><a href="#method-i-set_page">#set_page</a>
|
90
|
+
|
91
|
+
<li><a href="#method-i-update_sortables">#update_sortables</a>
|
92
|
+
|
93
|
+
</ul>
|
94
|
+
</nav>
|
95
|
+
|
96
|
+
</div>
|
97
|
+
|
98
|
+
<div id="project-metadata">
|
99
|
+
<nav id="fileindex-section" class="section project-section">
|
100
|
+
<h3 class="section-header">Pages</h3>
|
101
|
+
|
102
|
+
<ul>
|
103
|
+
|
104
|
+
<li class="file"><a href="./README_rdoc.html">README</a>
|
105
|
+
|
106
|
+
</ul>
|
107
|
+
</nav>
|
108
|
+
|
109
|
+
<nav id="classindex-section" class="section project-section">
|
110
|
+
<h3 class="section-header">Class and Module Index</h3>
|
111
|
+
|
112
|
+
<ul class="link-list">
|
113
|
+
|
114
|
+
<li><a href="./SortableSkima.html">SortableSkima</a>
|
115
|
+
|
116
|
+
<li><a href="./SortableSkima/Engine.html">SortableSkima::Engine</a>
|
117
|
+
|
118
|
+
<li><a href="./Backtrace.html">Backtrace</a>
|
119
|
+
|
120
|
+
<li><a href="./SortableHelper.html">SortableHelper</a>
|
121
|
+
|
122
|
+
</ul>
|
123
|
+
</nav>
|
124
|
+
|
125
|
+
</div>
|
126
|
+
</nav>
|
127
|
+
|
128
|
+
<div id="documentation">
|
129
|
+
<h1 class="class">class Backtrace</h1>
|
130
|
+
|
131
|
+
<div id="description" class="description">
|
132
|
+
|
133
|
+
<p>require ‘JSON’ module SortableBacktrace</p>
|
134
|
+
|
135
|
+
</div><!-- description -->
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
<!-- Constants -->
|
147
|
+
<section id="constants-list" class="section">
|
148
|
+
<h3 class="section-header">Constants</h3>
|
149
|
+
<dl>
|
150
|
+
|
151
|
+
<dt id="KEEP_FOR">KEEP_FOR
|
152
|
+
|
153
|
+
<dd class="description">
|
154
|
+
|
155
|
+
|
156
|
+
</dl>
|
157
|
+
</section>
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
<!-- Methods -->
|
163
|
+
|
164
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
165
|
+
<h3 class="section-header">Public Class Methods</h3>
|
166
|
+
|
167
|
+
|
168
|
+
<div id="method-c-clear_old_records" class="method-detail ">
|
169
|
+
|
170
|
+
<div class="method-heading">
|
171
|
+
<span class="method-name">clear_old_records</span><span
|
172
|
+
class="method-args">()</span>
|
173
|
+
<span class="method-click-advice">click to toggle source</span>
|
174
|
+
</div>
|
175
|
+
|
176
|
+
|
177
|
+
<div class="method-description">
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
<div class="method-source-code" id="clear_old_records-source">
|
184
|
+
<pre><span class="ruby-comment"># File lib/sortable_skima/backtrace.rb, line 8</span>
|
185
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">clear_old_records</span>
|
186
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">where</span>(<span class="ruby-node">"updated_at < #{Date.today - KEEP_FOR}"</span>).<span class="ruby-identifier">destroy_all</span>
|
187
|
+
<span class="ruby-keyword">end</span></pre>
|
188
|
+
</div><!-- clear_old_records-source -->
|
189
|
+
|
190
|
+
</div>
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
</div><!-- clear_old_records-method -->
|
196
|
+
|
197
|
+
|
198
|
+
<div id="method-c-for_token" class="method-detail ">
|
199
|
+
|
200
|
+
<div class="method-heading">
|
201
|
+
<span class="method-name">for_token</span><span
|
202
|
+
class="method-args">(token, user)</span>
|
203
|
+
<span class="method-click-advice">click to toggle source</span>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
|
207
|
+
<div class="method-description">
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
<div class="method-source-code" id="for_token-source">
|
214
|
+
<pre><span class="ruby-comment"># File lib/sortable_skima/backtrace.rb, line 12</span>
|
215
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">for_token</span> <span class="ruby-identifier">token</span>, <span class="ruby-identifier">user</span>
|
216
|
+
<span class="ruby-identifier">user_id</span> = <span class="ruby-identifier">user</span>.<span class="ruby-identifier">id</span>
|
217
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">where</span>(<span class="ruby-value">:action=</span><span class="ruby-operator">></span><span class="ruby-identifier">token</span>,<span class="ruby-value">:user_id=</span><span class="ruby-operator">></span><span class="ruby-identifier">user_id</span>).<span class="ruby-identifier">first</span> <span class="ruby-operator">||</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">create</span>(<span class="ruby-value">:action=</span><span class="ruby-operator">></span><span class="ruby-identifier">token</span>,<span class="ruby-value">:user_id=</span><span class="ruby-operator">></span><span class="ruby-identifier">user_id</span>)
|
218
|
+
<span class="ruby-keyword">end</span></pre>
|
219
|
+
</div><!-- for_token-source -->
|
220
|
+
|
221
|
+
</div>
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
</div><!-- for_token-method -->
|
227
|
+
|
228
|
+
|
229
|
+
</section><!-- public-class-method-details -->
|
230
|
+
|
231
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
232
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
233
|
+
|
234
|
+
|
235
|
+
<div id="method-i-get_filters" class="method-detail ">
|
236
|
+
|
237
|
+
<div class="method-heading">
|
238
|
+
<span class="method-name">get_filters</span><span
|
239
|
+
class="method-args">()</span>
|
240
|
+
<span class="method-click-advice">click to toggle source</span>
|
241
|
+
</div>
|
242
|
+
|
243
|
+
|
244
|
+
<div class="method-description">
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
<div class="method-source-code" id="get_filters-source">
|
251
|
+
<pre><span class="ruby-comment"># File lib/sortable_skima/backtrace.rb, line 27</span>
|
252
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_filters</span>
|
253
|
+
<span class="ruby-identifier">parsed_sortables</span>[<span class="ruby-string">'filters'</span>]
|
254
|
+
<span class="ruby-keyword">end</span></pre>
|
255
|
+
</div><!-- get_filters-source -->
|
256
|
+
|
257
|
+
</div>
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
</div><!-- get_filters-method -->
|
263
|
+
|
264
|
+
|
265
|
+
<div id="method-i-get_order" class="method-detail ">
|
266
|
+
|
267
|
+
<div class="method-heading">
|
268
|
+
<span class="method-name">get_order</span><span
|
269
|
+
class="method-args">()</span>
|
270
|
+
<span class="method-click-advice">click to toggle source</span>
|
271
|
+
</div>
|
272
|
+
|
273
|
+
|
274
|
+
<div class="method-description">
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
<div class="method-source-code" id="get_order-source">
|
281
|
+
<pre><span class="ruby-comment"># File lib/sortable_skima/backtrace.rb, line 24</span>
|
282
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_order</span>
|
283
|
+
<span class="ruby-identifier">parsed_sortables</span>[<span class="ruby-string">'order'</span>]
|
284
|
+
<span class="ruby-keyword">end</span></pre>
|
285
|
+
</div><!-- get_order-source -->
|
286
|
+
|
287
|
+
</div>
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
</div><!-- get_order-method -->
|
293
|
+
|
294
|
+
|
295
|
+
<div id="method-i-get_page" class="method-detail ">
|
296
|
+
|
297
|
+
<div class="method-heading">
|
298
|
+
<span class="method-name">get_page</span><span
|
299
|
+
class="method-args">()</span>
|
300
|
+
<span class="method-click-advice">click to toggle source</span>
|
301
|
+
</div>
|
302
|
+
|
303
|
+
|
304
|
+
<div class="method-description">
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
<div class="method-source-code" id="get_page-source">
|
311
|
+
<pre><span class="ruby-comment"># File lib/sortable_skima/backtrace.rb, line 30</span>
|
312
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_page</span>
|
313
|
+
<span class="ruby-identifier">parsed_sortables</span>[<span class="ruby-string">'page'</span>]
|
314
|
+
<span class="ruby-keyword">end</span></pre>
|
315
|
+
</div><!-- get_page-source -->
|
316
|
+
|
317
|
+
</div>
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
</div><!-- get_page-method -->
|
323
|
+
|
324
|
+
|
325
|
+
<div id="method-i-parsed_sortables" class="method-detail ">
|
326
|
+
|
327
|
+
<div class="method-heading">
|
328
|
+
<span class="method-name">parsed_sortables</span><span
|
329
|
+
class="method-args">()</span>
|
330
|
+
<span class="method-click-advice">click to toggle source</span>
|
331
|
+
</div>
|
332
|
+
|
333
|
+
|
334
|
+
<div class="method-description">
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
<div class="method-source-code" id="parsed_sortables-source">
|
341
|
+
<pre><span class="ruby-comment"># File lib/sortable_skima/backtrace.rb, line 17</span>
|
342
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">parsed_sortables</span>
|
343
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@parsed_sortables</span>.<span class="ruby-identifier">nil?</span>
|
344
|
+
<span class="ruby-ivar">@parsed_sortables</span> = <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">value</span> <span class="ruby-operator">||</span> <span class="ruby-string">'{}'</span>)
|
345
|
+
<span class="ruby-keyword">end</span>
|
346
|
+
<span class="ruby-ivar">@parsed_sortables</span>
|
347
|
+
<span class="ruby-keyword">end</span></pre>
|
348
|
+
</div><!-- parsed_sortables-source -->
|
349
|
+
|
350
|
+
</div>
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
</div><!-- parsed_sortables-method -->
|
356
|
+
|
357
|
+
|
358
|
+
<div id="method-i-set_filters" class="method-detail ">
|
359
|
+
|
360
|
+
<div class="method-heading">
|
361
|
+
<span class="method-name">set_filters</span><span
|
362
|
+
class="method-args">(new_filters)</span>
|
363
|
+
<span class="method-click-advice">click to toggle source</span>
|
364
|
+
</div>
|
365
|
+
|
366
|
+
|
367
|
+
<div class="method-description">
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
<div class="method-source-code" id="set_filters-source">
|
374
|
+
<pre><span class="ruby-comment"># File lib/sortable_skima/backtrace.rb, line 37</span>
|
375
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">set_filters</span> <span class="ruby-identifier">new_filters</span>
|
376
|
+
<span class="ruby-identifier">parsed_sortables</span>[<span class="ruby-string">'filters'</span>] = <span class="ruby-identifier">new_filters</span>
|
377
|
+
<span class="ruby-keyword">end</span></pre>
|
378
|
+
</div><!-- set_filters-source -->
|
379
|
+
|
380
|
+
</div>
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
</div><!-- set_filters-method -->
|
386
|
+
|
387
|
+
|
388
|
+
<div id="method-i-set_order" class="method-detail ">
|
389
|
+
|
390
|
+
<div class="method-heading">
|
391
|
+
<span class="method-name">set_order</span><span
|
392
|
+
class="method-args">(new_order)</span>
|
393
|
+
<span class="method-click-advice">click to toggle source</span>
|
394
|
+
</div>
|
395
|
+
|
396
|
+
|
397
|
+
<div class="method-description">
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
<div class="method-source-code" id="set_order-source">
|
404
|
+
<pre><span class="ruby-comment"># File lib/sortable_skima/backtrace.rb, line 34</span>
|
405
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">set_order</span> <span class="ruby-identifier">new_order</span>
|
406
|
+
<span class="ruby-identifier">parsed_sortables</span>[<span class="ruby-string">'order'</span>] = <span class="ruby-identifier">new_order</span>
|
407
|
+
<span class="ruby-keyword">end</span></pre>
|
408
|
+
</div><!-- set_order-source -->
|
409
|
+
|
410
|
+
</div>
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
</div><!-- set_order-method -->
|
416
|
+
|
417
|
+
|
418
|
+
<div id="method-i-set_page" class="method-detail ">
|
419
|
+
|
420
|
+
<div class="method-heading">
|
421
|
+
<span class="method-name">set_page</span><span
|
422
|
+
class="method-args">(new_page)</span>
|
423
|
+
<span class="method-click-advice">click to toggle source</span>
|
424
|
+
</div>
|
425
|
+
|
426
|
+
|
427
|
+
<div class="method-description">
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
<div class="method-source-code" id="set_page-source">
|
434
|
+
<pre><span class="ruby-comment"># File lib/sortable_skima/backtrace.rb, line 40</span>
|
435
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">set_page</span> <span class="ruby-identifier">new_page</span>
|
436
|
+
<span class="ruby-identifier">parsed_sortables</span>[<span class="ruby-string">'page'</span>] = <span class="ruby-identifier">new_page</span>
|
437
|
+
<span class="ruby-keyword">end</span></pre>
|
438
|
+
</div><!-- set_page-source -->
|
439
|
+
|
440
|
+
</div>
|
441
|
+
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
</div><!-- set_page-method -->
|
446
|
+
|
447
|
+
|
448
|
+
<div id="method-i-update_sortables" class="method-detail ">
|
449
|
+
|
450
|
+
<div class="method-heading">
|
451
|
+
<span class="method-name">update_sortables</span><span
|
452
|
+
class="method-args">(n_filters = nil , n_order = nil, n_page = nil)</span>
|
453
|
+
<span class="method-click-advice">click to toggle source</span>
|
454
|
+
</div>
|
455
|
+
|
456
|
+
|
457
|
+
<div class="method-description">
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
<div class="method-source-code" id="update_sortables-source">
|
464
|
+
<pre><span class="ruby-comment"># File lib/sortable_skima/backtrace.rb, line 44</span>
|
465
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">update_sortables</span> <span class="ruby-identifier">n_filters</span> = <span class="ruby-keyword">nil</span> , <span class="ruby-identifier">n_order</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">n_page</span> = <span class="ruby-keyword">nil</span>
|
466
|
+
<span class="ruby-identifier">set_filters</span> <span class="ruby-identifier">n_filters</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">n_filters</span>.<span class="ruby-identifier">nil?</span>
|
467
|
+
<span class="ruby-identifier">set_order</span> <span class="ruby-identifier">n_order</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">n_order</span>.<span class="ruby-identifier">nil?</span>
|
468
|
+
<span class="ruby-identifier">set_page</span> <span class="ruby-identifier">n_page</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">n_page</span>.<span class="ruby-identifier">nil?</span>
|
469
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">update_attribute</span> <span class="ruby-value">:value</span>, <span class="ruby-identifier">parsed_sortables</span>.<span class="ruby-identifier">to_json</span>
|
470
|
+
<span class="ruby-keyword">end</span></pre>
|
471
|
+
</div><!-- update_sortables-source -->
|
472
|
+
|
473
|
+
</div>
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
|
478
|
+
</div><!-- update_sortables-method -->
|
479
|
+
|
480
|
+
|
481
|
+
</section><!-- public-instance-method-details -->
|
482
|
+
|
483
|
+
</section><!-- 5Buntitled-5D -->
|
484
|
+
|
485
|
+
</div><!-- documentation -->
|
486
|
+
|
487
|
+
|
488
|
+
<footer id="validator-badges">
|
489
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
490
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.2.
|
491
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
492
|
+
</footer>
|
493
|
+
|