active_scaffold_vho 3.2.14 → 4.0.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/Gemfile.lock +61 -69
- data/active_scaffold_vho.gemspec +1 -1
- data/frontends/default/views/_form_association.html.erb +1 -1
- data/frontends/default/views/_list_record.html.erb +1 -1
- data/lib/active_scaffold.rb +5 -5
- data/lib/active_scaffold/actions/list.rb +6 -5
- data/lib/active_scaffold/attribute_params.rb +1 -1
- data/lib/active_scaffold/bridges/date_picker/lib/datepicker_bridge.rb +2 -2
- data/lib/active_scaffold/extensions/action_view_resolver.rb +1 -1
- data/lib/active_scaffold/extensions/name_option_for_datetime.rb +14 -8
- data/lib/active_scaffold/extensions/unsaved_associated.rb +3 -3
- data/lib/active_scaffold/finder.rb +7 -7
- data/lib/active_scaffold/helpers/form_column_helpers.rb +4 -3
- data/lib/active_scaffold/helpers/human_condition_helpers.rb +1 -1
- data/lib/active_scaffold/helpers/list_column_helpers.rb +10 -10
- data/lib/active_scaffold/helpers/view_helpers.rb +6 -2
- data/lib/active_scaffold/marked_model.rb +4 -4
- data/lib/active_scaffold/version.rb +3 -3
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 16c43edc7915430121126d58256c1870f4c004d8
|
|
4
|
+
data.tar.gz: d5d5d3062d893e999c1d5f3a0d1e784a62754969
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6cfcc4ed805ac16c9e7e0f11e8f0595a427d247e86ddad061fd588083a141270596400e80704dd422f977b4f07d9c2d527a1fcba0b1f051ac3a0ca456005ef94
|
|
7
|
+
data.tar.gz: d30b2830c55b320eb4a2c511f335954fddee15b3b62e91f64e034855412af80b6a10dd65cf5844ff562d2b3623a1a39d973ca19709a2cd5d8b4cc480031b61ce
|
data/Gemfile.lock
CHANGED
|
@@ -1,98 +1,90 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
active_scaffold_vho (
|
|
4
|
+
active_scaffold_vho (4.0.0)
|
|
5
5
|
kaminari
|
|
6
|
-
rails (
|
|
6
|
+
rails (~> 4.0.0)
|
|
7
7
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: http://rubygems.org/
|
|
10
10
|
specs:
|
|
11
|
-
actionmailer (
|
|
12
|
-
actionpack (=
|
|
13
|
-
mail (~> 2.5.4)
|
|
14
|
-
actionpack (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
builder (~> 3.0.0)
|
|
11
|
+
actionmailer (4.0.13)
|
|
12
|
+
actionpack (= 4.0.13)
|
|
13
|
+
mail (~> 2.5, >= 2.5.4)
|
|
14
|
+
actionpack (4.0.13)
|
|
15
|
+
activesupport (= 4.0.13)
|
|
16
|
+
builder (~> 3.1.0)
|
|
18
17
|
erubis (~> 2.7.0)
|
|
19
|
-
|
|
20
|
-
rack (~>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
builder (3.0.4)
|
|
18
|
+
rack (~> 1.5.2)
|
|
19
|
+
rack-test (~> 0.6.2)
|
|
20
|
+
activemodel (4.0.13)
|
|
21
|
+
activesupport (= 4.0.13)
|
|
22
|
+
builder (~> 3.1.0)
|
|
23
|
+
activerecord (4.0.13)
|
|
24
|
+
activemodel (= 4.0.13)
|
|
25
|
+
activerecord-deprecated_finders (~> 1.0.2)
|
|
26
|
+
activesupport (= 4.0.13)
|
|
27
|
+
arel (~> 4.0.0)
|
|
28
|
+
activerecord-deprecated_finders (1.0.4)
|
|
29
|
+
activesupport (4.0.13)
|
|
30
|
+
i18n (~> 0.6, >= 0.6.9)
|
|
31
|
+
minitest (~> 4.2)
|
|
32
|
+
multi_json (~> 1.3)
|
|
33
|
+
thread_safe (~> 0.1)
|
|
34
|
+
tzinfo (~> 0.3.37)
|
|
35
|
+
arel (4.0.2)
|
|
36
|
+
builder (3.1.4)
|
|
37
|
+
concurrent-ruby (1.0.2)
|
|
40
38
|
docile (1.1.5)
|
|
41
39
|
erubis (2.7.0)
|
|
42
|
-
hike (1.2.3)
|
|
43
40
|
i18n (0.7.0)
|
|
44
|
-
journey (1.0.4)
|
|
45
|
-
json (1.8.3)
|
|
46
41
|
kaminari (0.17.0)
|
|
47
42
|
actionpack (>= 3.0.0)
|
|
48
43
|
activesupport (>= 3.0.0)
|
|
49
|
-
mail (2.
|
|
50
|
-
mime-types (
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
mail (2.6.4)
|
|
45
|
+
mime-types (>= 1.16, < 4)
|
|
46
|
+
mime-types (3.1)
|
|
47
|
+
mime-types-data (~> 3.2015)
|
|
48
|
+
mime-types-data (3.2016.0521)
|
|
49
|
+
minitest (4.7.5)
|
|
53
50
|
multi_json (1.12.1)
|
|
54
|
-
|
|
55
|
-
rack (1.4.7)
|
|
56
|
-
rack-cache (1.6.1)
|
|
57
|
-
rack (>= 0.4)
|
|
58
|
-
rack-ssl (1.3.4)
|
|
59
|
-
rack
|
|
51
|
+
rack (1.5.5)
|
|
60
52
|
rack-test (0.6.3)
|
|
61
53
|
rack (>= 1.0)
|
|
62
|
-
rails (
|
|
63
|
-
actionmailer (=
|
|
64
|
-
actionpack (=
|
|
65
|
-
activerecord (=
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
railties (
|
|
71
|
-
actionpack (=
|
|
72
|
-
activesupport (=
|
|
73
|
-
rack-ssl (~> 1.3.2)
|
|
54
|
+
rails (4.0.13)
|
|
55
|
+
actionmailer (= 4.0.13)
|
|
56
|
+
actionpack (= 4.0.13)
|
|
57
|
+
activerecord (= 4.0.13)
|
|
58
|
+
activesupport (= 4.0.13)
|
|
59
|
+
bundler (>= 1.3.0, < 2.0)
|
|
60
|
+
railties (= 4.0.13)
|
|
61
|
+
sprockets-rails (~> 2.0)
|
|
62
|
+
railties (4.0.13)
|
|
63
|
+
actionpack (= 4.0.13)
|
|
64
|
+
activesupport (= 4.0.13)
|
|
74
65
|
rake (>= 0.8.7)
|
|
75
|
-
|
|
76
|
-
thor (>= 0.14.6, < 2.0)
|
|
66
|
+
thor (>= 0.18.1, < 2.0)
|
|
77
67
|
rake (11.2.2)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
68
|
+
shoulda (3.5.0)
|
|
69
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
|
70
|
+
shoulda-matchers (>= 1.4.1, < 3.0)
|
|
71
|
+
shoulda-context (1.2.1)
|
|
72
|
+
shoulda-matchers (2.8.0)
|
|
73
|
+
activesupport (>= 3.0.0)
|
|
81
74
|
simplecov (0.9.2)
|
|
82
75
|
docile (~> 1.1.0)
|
|
83
76
|
multi_json (~> 1.0)
|
|
84
77
|
simplecov-html (~> 0.9.0)
|
|
85
78
|
simplecov-html (0.9.0)
|
|
86
|
-
sprockets (
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
79
|
+
sprockets (3.7.0)
|
|
80
|
+
concurrent-ruby (~> 1.0)
|
|
81
|
+
rack (> 1, < 3)
|
|
82
|
+
sprockets-rails (2.3.3)
|
|
83
|
+
actionpack (>= 3.0)
|
|
84
|
+
activesupport (>= 3.0)
|
|
85
|
+
sprockets (>= 2.8, < 4.0)
|
|
91
86
|
thor (0.19.1)
|
|
92
|
-
|
|
93
|
-
treetop (1.4.15)
|
|
94
|
-
polyglot
|
|
95
|
-
polyglot (>= 0.3.1)
|
|
87
|
+
thread_safe (0.3.5)
|
|
96
88
|
tzinfo (0.3.51)
|
|
97
89
|
|
|
98
90
|
PLATFORMS
|
data/active_scaffold_vho.gemspec
CHANGED
|
@@ -26,6 +26,6 @@ Gem::Specification.new do |s|
|
|
|
26
26
|
s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
|
|
27
27
|
s.add_development_dependency(%q<simplecov>, ["~> 0.9.0"])
|
|
28
28
|
|
|
29
|
-
s.add_runtime_dependency(%q<rails>, ["
|
|
29
|
+
s.add_runtime_dependency(%q<rails>, ["~> 4.0.0"])
|
|
30
30
|
s.add_runtime_dependency(%q<kaminari>)
|
|
31
31
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<%
|
|
2
2
|
parent_record = @record
|
|
3
|
-
associated = column.singular_association? ? [parent_record.send(column.name)].compact : parent_record.send(column.name).
|
|
3
|
+
associated = column.singular_association? ? [parent_record.send(column.name)].compact : parent_record.send(column.name).to_a
|
|
4
4
|
associated = associated.sort_by {|r| r.new_record? ? 99999999999 : r.id} unless column.association.options.has_key?(:order)
|
|
5
5
|
if column.show_blank_record? associated
|
|
6
6
|
associated << if column.singular_association?
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%
|
|
2
|
-
record = list_record if list_record # compat with render :partial :collection
|
|
2
|
+
record = list_record if local_assigns[:list_record] # compat with render :partial :collection
|
|
3
3
|
columns ||= list_columns
|
|
4
4
|
tr_class = cycle("", "even-record")
|
|
5
5
|
tr_class += " #{list_row_class(record)}" if respond_to? :list_row_class
|
data/lib/active_scaffold.rb
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
unless Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR >= 0
|
|
2
|
-
raise "This version of ActiveScaffold requires Rails 3.0 or higher. Please use an earlier version."
|
|
3
|
-
end
|
|
4
|
-
|
|
5
1
|
begin
|
|
6
2
|
require 'render_component'
|
|
7
3
|
rescue LoadError
|
|
@@ -189,7 +185,11 @@ module ActiveScaffold
|
|
|
189
185
|
|
|
190
186
|
# defines the attribute read methods on the model, so record.send() doesn't find protected/private methods instead
|
|
191
187
|
klass = self.active_scaffold_config.model
|
|
192
|
-
|
|
188
|
+
|
|
189
|
+
if !klass.respond_to?(:attribute_methods_generated) || !klass.attribute_methods_generated?
|
|
190
|
+
klass.define_attribute_methods
|
|
191
|
+
end
|
|
192
|
+
|
|
193
193
|
# include the rest of the code into the controller: the action core and the included actions
|
|
194
194
|
module_eval do
|
|
195
195
|
include ActiveScaffold::Finder
|
|
@@ -96,13 +96,14 @@ module ActiveScaffold::Actions
|
|
|
96
96
|
|
|
97
97
|
def each_record_in_scope
|
|
98
98
|
do_search if respond_to? :do_search, true
|
|
99
|
-
finder_options = { :
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
finder_options = { :reorder => "#{active_scaffold_config.model.connection.quote_table_name(active_scaffold_config.model.table_name)}.#{active_scaffold_config.model.primary_key} ASC",
|
|
100
|
+
:where => all_conditions,
|
|
101
|
+
:joins => joins_for_finder}
|
|
102
102
|
finder_options.merge! custom_finder_options
|
|
103
|
-
finder_options.merge! :
|
|
103
|
+
finder_options.merge! :includes => (active_scaffold_includes.blank? ? nil : active_scaffold_includes)
|
|
104
104
|
klass = beginning_of_chain
|
|
105
|
-
klass
|
|
105
|
+
append_to_query(klass, finder_options)
|
|
106
|
+
klass.find_each {|record| yield record}
|
|
106
107
|
end
|
|
107
108
|
|
|
108
109
|
# The default security delegates to ActiveRecordPermissions.
|
|
@@ -144,7 +144,7 @@ module ActiveScaffold
|
|
|
144
144
|
|
|
145
145
|
def column_plural_assocation_value_from_value(column, value)
|
|
146
146
|
# it's an array of ids
|
|
147
|
-
if value
|
|
147
|
+
if value && !value.empty?
|
|
148
148
|
ids = value.select {|id| id.respond_to?(:empty?) ? !id.empty? : true}
|
|
149
149
|
ids.empty? ? [] : column.association.klass.find(ids)
|
|
150
150
|
end
|
|
@@ -4,7 +4,7 @@ module ActionView
|
|
|
4
4
|
# activescaffolds view path do not have a subdir, so just remove the prefix
|
|
5
5
|
# > rails 3.2.22 uses an additional fifth parameter
|
|
6
6
|
def find_templates(name, prefix, partial, details, outside_app_allowed = false)
|
|
7
|
-
if ::Rails::VERSION::MAJOR >= 4 || (::Rails::VERSION::MAJOR == 3 && ::Rails::VERSION::MINOR == 2 && ::Rails::VERSION::TINY >= 22)
|
|
7
|
+
if (::Rails::VERSION::MAJOR >= 4 && ::Rails::VERSION::MINOR > 0) || (::Rails::VERSION::MAJOR == 3 && ::Rails::VERSION::MINOR == 2 && ::Rails::VERSION::TINY >= 22)
|
|
8
8
|
super(name,'',partial, details, outside_app_allowed)
|
|
9
9
|
else
|
|
10
10
|
super(name,'',partial, details)
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
module
|
|
2
|
-
module
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
module ActiveScaffold
|
|
2
|
+
module DateSelectExtension
|
|
3
|
+
def datetime_selector_with_name(options, html_options)
|
|
4
|
+
options.merge!(:prefix => options[:name].gsub(/\[[^\[]*\]$/,'')) if options[:name]
|
|
5
|
+
datetime_selector_without_name(options, html_options)
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def self.included(base)
|
|
9
|
+
base.class_eval do
|
|
10
|
+
alias_method_chain :datetime_selector, :name
|
|
11
|
+
private :datetime_selector_without_name, :datetime_selector_with_name, :datetime_selector
|
|
8
12
|
end
|
|
9
|
-
alias_method_chain :datetime_selector, :name
|
|
10
13
|
end
|
|
11
14
|
end
|
|
12
15
|
end
|
|
16
|
+
(defined?(ActionView::Helpers::Tags::DateSelect) ? ActionView::Helpers::Tags::DateSelect : ActionView::Helpers::InstanceTag).class_eval do
|
|
17
|
+
include ActiveScaffold::DateSelectExtension
|
|
18
|
+
end
|
|
@@ -48,9 +48,9 @@ class ActiveRecord::Base
|
|
|
48
48
|
# returns true otherwise, even when none of the associations have been instantiated. build wrapper methods accordingly.
|
|
49
49
|
def with_unsaved_associated
|
|
50
50
|
associations_for_update.all? do |association|
|
|
51
|
-
association_proxy =
|
|
52
|
-
if association_proxy
|
|
53
|
-
records = association_proxy
|
|
51
|
+
association_proxy = self.association(association.name)
|
|
52
|
+
if association_proxy.target.present?
|
|
53
|
+
records = association_proxy.target
|
|
54
54
|
records = [records] unless records.is_a? Array # convert singular associations into collections for ease of use
|
|
55
55
|
records.select {|r| r.unsaved? and not r.readonly?}.all? {|r| yield r} # must use select instead of find_all, which Rails overrides on association proxies for db access
|
|
56
56
|
else
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
module ActiveScaffold
|
|
2
2
|
module Finder
|
|
3
|
+
|
|
4
|
+
extend ActiveSupport::Concern
|
|
5
|
+
included do
|
|
6
|
+
helper_method :append_to_query
|
|
7
|
+
end
|
|
8
|
+
|
|
3
9
|
def self.like_operator
|
|
4
10
|
@@like_operator ||= ::ActiveRecord::Base.connection.adapter_name == "PostgreSQL" ? "ILIKE" : "LIKE"
|
|
5
11
|
end
|
|
@@ -214,12 +220,6 @@ module ActiveScaffold
|
|
|
214
220
|
:null,
|
|
215
221
|
:not_null
|
|
216
222
|
]
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
def self.included(klass)
|
|
221
|
-
klass.extend ClassMethods
|
|
222
|
-
end
|
|
223
223
|
|
|
224
224
|
protected
|
|
225
225
|
|
|
@@ -286,7 +286,7 @@ module ActiveScaffold
|
|
|
286
286
|
|
|
287
287
|
# we build the paginator differently for method- and sql-based sorting
|
|
288
288
|
records = if options[:sorting] && options[:sorting].sorts_by_method?
|
|
289
|
-
Kaminari.paginate_array(sort_collection_by_column(append_to_query(klass, finder_options).
|
|
289
|
+
Kaminari.paginate_array(sort_collection_by_column(append_to_query(klass, finder_options).to_a, *options[:sorting].first))
|
|
290
290
|
else
|
|
291
291
|
append_to_query(klass, finder_options)
|
|
292
292
|
end
|
|
@@ -94,7 +94,7 @@ module ActiveScaffold
|
|
|
94
94
|
options = active_scaffold_input_text_options(options) if text_types.include?(column.column.type)
|
|
95
95
|
if column.column.type == :string && options[:maxlength].blank?
|
|
96
96
|
options[:maxlength] = column.column.limit
|
|
97
|
-
options[:size] ||=
|
|
97
|
+
options[:size] ||= options[:maxlength].to_i > 30 ? 30 : options[:maxlength]
|
|
98
98
|
end
|
|
99
99
|
options[:include_blank] = true if column.column.null and [:date, :datetime, :time].include?(column.column.type)
|
|
100
100
|
options[:value] = format_number_value(@record.send(column.name), column.options) if column.column.number?
|
|
@@ -212,7 +212,8 @@ module ActiveScaffold
|
|
|
212
212
|
record_select_options = {:controller => remote_controller, :id => options[:id]}
|
|
213
213
|
record_select_options.merge!(active_scaffold_input_text_options)
|
|
214
214
|
record_select_options.merge!(column.options)
|
|
215
|
-
|
|
215
|
+
|
|
216
|
+
record_select_options[:size] ||= ActionView::Helpers::InstanceTag::DEFAULT_FIELD_OPTIONS["size"] unless defined?(ActionView::Helpers::Tags::DateSelect)
|
|
216
217
|
|
|
217
218
|
unless options['data-update_url'].nil?
|
|
218
219
|
record_select_options['data-update_url'] = options['data-update_url']
|
|
@@ -359,7 +360,7 @@ module ActiveScaffold
|
|
|
359
360
|
record_select_field(options[:name], @record, options)
|
|
360
361
|
else
|
|
361
362
|
select_options = options_for_select(options_for_association(nested.association)) #unless column.through_association?
|
|
362
|
-
select_options ||= options_for_select(active_scaffold_config.model.
|
|
363
|
+
select_options ||= options_for_select(active_scaffold_config.model.to_a.collect {|c| [h(c.to_label), c.id]})
|
|
363
364
|
select_tag 'associated_id', ('<option value="">' + as_(:_select_) + '</option>' + select_options).html_safe unless select_options.empty?
|
|
364
365
|
end
|
|
365
366
|
end
|
|
@@ -16,7 +16,7 @@ module ActiveScaffold
|
|
|
16
16
|
when :integer, :decimal, :float
|
|
17
17
|
"#{column.active_record_class.human_attribute_name(column.name)} #{as_(value[:opt].downcase).downcase} #{format_number_value(controller.class.condition_value_for_numeric(column, value[:from]), column.options)} #{value[:opt] == 'BETWEEN' ? '- ' + format_number_value(controller.class.condition_value_for_numeric(column, value[:to]), column.options).to_s : ''}"
|
|
18
18
|
when :string
|
|
19
|
-
opt = ActiveScaffold::Finder::StringComparators.
|
|
19
|
+
opt = ActiveScaffold::Finder::StringComparators.key(value[:opt]) || value[:opt]
|
|
20
20
|
"#{column.active_record_class.human_attribute_name(column.name)} #{as_(opt).downcase} '#{column.stripped_value(value[:from])}' #{opt == 'BETWEEN' ? '- ' + column.stripped_value(value[:to]).to_s : ''}"
|
|
21
21
|
when :date, :time, :datetime, :timestamp
|
|
22
22
|
conversion = column.column.type == :date ? :to_date : :to_time
|
|
@@ -102,21 +102,21 @@ module ActiveScaffold
|
|
|
102
102
|
end
|
|
103
103
|
|
|
104
104
|
# There are two basic ways to clean a column's value: h() and sanitize(). The latter is useful
|
|
105
|
-
# when the column contains *valid* html data, and you want to just disable any scripting.
|
|
106
|
-
#
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
105
|
+
# when the column contains *valid* html data, and you want to just disable any scripting.
|
|
106
|
+
# if sanitize_value key is passed to this function sanitize will be used
|
|
107
|
+
def clean_column_value(v, options = {})
|
|
108
|
+
if (options[:sanitize_value].present?)
|
|
109
|
+
sanitize(v)
|
|
110
|
+
else
|
|
111
|
+
h(v)
|
|
112
|
+
end
|
|
113
113
|
end
|
|
114
114
|
|
|
115
115
|
##
|
|
116
116
|
## Overrides
|
|
117
117
|
##
|
|
118
118
|
def active_scaffold_column_text(column, record)
|
|
119
|
-
truncate(clean_column_value(record.send(column.name)), :length => column.options[:truncate] || 50)
|
|
119
|
+
truncate(clean_column_value(record.send(column.name), column.options), :length => column.options[:truncate] || 50)
|
|
120
120
|
end
|
|
121
121
|
|
|
122
122
|
def active_scaffold_column_select(column, record)
|
|
@@ -236,7 +236,7 @@ module ActiveScaffold
|
|
|
236
236
|
else
|
|
237
237
|
column_value.to_s
|
|
238
238
|
end
|
|
239
|
-
clean_column_value(value)
|
|
239
|
+
clean_column_value(value, options)
|
|
240
240
|
end
|
|
241
241
|
|
|
242
242
|
def cache_association(value, column)
|
|
@@ -301,8 +301,12 @@ module ActiveScaffold
|
|
|
301
301
|
conditions = controller.send(:all_conditions)
|
|
302
302
|
includes = active_scaffold_config.list.count_includes
|
|
303
303
|
includes ||= controller.send(:active_scaffold_includes) unless conditions.nil?
|
|
304
|
-
|
|
305
|
-
|
|
304
|
+
calculation_scope = beginning_of_chain
|
|
305
|
+
append_to_query(calculation_scope, {
|
|
306
|
+
:where => conditions,
|
|
307
|
+
:joins => controller.send(:joins_for_collection),
|
|
308
|
+
:includes => includes})
|
|
309
|
+
calculation_scope.calculate(column.calculate, column.name)
|
|
306
310
|
else
|
|
307
311
|
column.calculate.call(@records)
|
|
308
312
|
end
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
module ActiveScaffold
|
|
2
2
|
module MarkedModel
|
|
3
3
|
# This is a module aimed at making the make session_stored marked_records available to ActiveRecord models
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
|
|
5
|
+
extend ActiveSupport::Concern
|
|
6
|
+
included do
|
|
7
|
+
scope :marked, -> { where(primary_key => marked_records.to_a)}
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def marked
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active_scaffold_vho
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Many, see README
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-09-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: shoulda
|
|
@@ -56,16 +56,16 @@ dependencies:
|
|
|
56
56
|
name: rails
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- -
|
|
59
|
+
- - ~>
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version:
|
|
61
|
+
version: 4.0.0
|
|
62
62
|
type: :runtime
|
|
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:
|
|
68
|
+
version: 4.0.0
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: kaminari
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|