active_scaffold_config_list 3.2.3 → 3.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -49,9 +49,29 @@ module ActiveScaffold::Actions
49
49
  @config_list_params = config_list.map(&:to_sym)
50
50
  end
51
51
 
52
+ def objects_for_etag
53
+ # only override when list_columns is called, so
54
+ if @list_columns && config_list_record
55
+ @last_modified = [@last_modified, config_list_record.updated_at].compact.maximum if config_list_record.respond_to? :updated_at
56
+ [super, config_list_record]
57
+ else
58
+ super
59
+ end
60
+ end
61
+
62
+ def config_list_record
63
+ return @config_list_record if defined? @config_list_record
64
+ @config_list_record = if active_scaffold_config.config_list.save_to_user
65
+ current_user = send(ActiveRecordPermissions.current_user_method)
66
+ if current_user
67
+ current_user.send(active_scaffold_config.config_list.save_to_user, active_scaffold_session_storage_key, controller_name)
68
+ end
69
+ end
70
+ end
71
+
52
72
  def config_list_params
53
- @config_list_params = if active_scaffold_config.config_list.save_to_user && current_user = send(ActiveRecordPermissions.current_user_method)
54
- params = current_user.send(active_scaffold_config.config_list.save_to_user, active_scaffold_session_storage_key, controller_name).config_list
73
+ @config_list_params = if config_list_record
74
+ params = config_list_record.config_list
55
75
  params.split(',').map(&:to_sym) if params
56
76
  else
57
77
  active_scaffold_session_storage[:config_list]
@@ -62,7 +82,7 @@ module ActiveScaffold::Actions
62
82
  def list_columns
63
83
  @list_columns ||= begin
64
84
  columns = super
65
- if !config_list_params.nil? && config_list_params.is_a?(Array)
85
+ if config_list_params.present?
66
86
  config_list = Hash[config_list_params.each_with_index.map{|c,i| [c,i]}]
67
87
  columns.select{|column| config_list.include? column.name}.sort{|x,y| config_list[x.name] <=> config_list[y.name]}
68
88
  else
@@ -29,7 +29,7 @@ module ActiveScaffold::Config
29
29
  # ----------------------------
30
30
  # the label= method already exists in the Form base class
31
31
  def label
32
- @label ? as_(@label) : as_(:config_list_model, :model => @core.label.singularize)
32
+ @label ? as_(@label) : as_(:config_list_model, :model => @core.label)
33
33
  end
34
34
 
35
35
  # if you do not want to show all columns as a default you may define some
@@ -2,7 +2,7 @@ module ActiveScaffoldConfigList
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 2
5
- PATCH = 3
5
+ PATCH = 4
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold_config_list
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 2
9
- - 3
10
- version: 3.2.3
9
+ - 4
10
+ version: 3.2.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sergio Cambra
@@ -15,10 +15,11 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-05-28 00:00:00 Z
18
+ date: 2013-10-04 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- version_requirements: &id001 !ruby/object:Gem::Requirement
21
+ type: :runtime
22
+ requirement: &id001 !ruby/object:Gem::Requirement
22
23
  none: false
23
24
  requirements:
24
25
  - - ">="
@@ -29,12 +30,12 @@ dependencies:
29
30
  - 3
30
31
  - 0
31
32
  version: 3.3.0
33
+ version_requirements: *id001
32
34
  prerelease: false
33
- type: :runtime
34
- requirement: *id001
35
35
  name: active_scaffold
36
36
  - !ruby/object:Gem::Dependency
37
- version_requirements: &id002 !ruby/object:Gem::Requirement
37
+ type: :runtime
38
+ requirement: &id002 !ruby/object:Gem::Requirement
38
39
  none: false
39
40
  requirements:
40
41
  - - ">="
@@ -45,9 +46,8 @@ dependencies:
45
46
  - 2
46
47
  - 2
47
48
  version: 3.2.2
49
+ version_requirements: *id002
48
50
  prerelease: false
49
- type: :runtime
50
- requirement: *id002
51
51
  name: active_scaffold_sortable
52
52
  description: User may reorder and hide/show list columns
53
53
  email: activescaffold@googlegroups.com
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  requirements: []
100
100
 
101
101
  rubyforge_project:
102
- rubygems_version: 1.8.19
102
+ rubygems_version: 1.8.24
103
103
  signing_key:
104
104
  specification_version: 3
105
105
  summary: User specific column configuration for ActiveScaffold