active_scaffold_vho 3.0.17 → 3.0.18

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{active_scaffold_vho}
8
- s.version = "3.0.17"
8
+ s.version = "3.0.18"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Many, see README"]
12
- s.date = %q{2011-03-14}
12
+ s.date = %q{2011-03-27}
13
13
  s.description = %q{Save time and headaches, and create a more easily maintainable set of pages, with ActiveScaffold. ActiveScaffold handles all your CRUD (create, read, update, delete) user interface needs, leaving you more time to focus on more challenging (and interesting!) problems.}
14
14
  s.email = %q{activescaffold@googlegroups.com}
15
15
  s.extra_rdoc_files = [
@@ -168,7 +168,7 @@ $(document).ready(function() {
168
168
 
169
169
  if (span.closest('div.active-scaffold').attr('data-eid')) {
170
170
  if (options['params'].length > 0) {
171
- options['params'] += ";";
171
+ options['params'] += "&";
172
172
  }
173
173
  options['params'] += ("eid=" + span.closest('div.active-scaffold').attr('data-eid'));
174
174
  }
@@ -184,7 +184,7 @@ document.observe("dom:loaded", function() {
184
184
 
185
185
  if (span.up('div.active-scaffold').readAttribute('data-eid')) {
186
186
  if (options['params'].length > 0) {
187
- options['params'] += ";";
187
+ options['params'] += "&";
188
188
  }
189
189
  options['params'] += ("eid=" + span.up('div.active-scaffold').readAttribute('data-eid'));
190
190
  }
@@ -15,7 +15,7 @@ if controller.send :successful?
15
15
  end
16
16
  end
17
17
  #page.call 'ActiveScaffold.replace', active_scaffold_calculations_id, render(:partial => 'list_calculations') if active_scaffold_config.list.columns.any? {|c| c.calculation?}
18
- elsif (active_scaffold_config.update.refresh_list)
18
+ elsif update_refresh_list?
19
19
  page.call 'ActiveScaffold.replace_html', active_scaffold_content_id, render(:partial => 'list', :layout => false)
20
20
  else
21
21
  updated_row = render :partial => 'list_record', :locals => {:record => @record}
@@ -5,6 +5,7 @@ module ActiveScaffold::Actions
5
5
  base.verify :method => [:post, :put],
6
6
  :only => :update,
7
7
  :redirect_to => { :action => :index }
8
+ base.helper_method :update_refresh_list?
8
9
  end
9
10
 
10
11
  def edit
@@ -49,7 +50,7 @@ module ActiveScaffold::Actions
49
50
  end
50
51
  end
51
52
  def update_respond_to_js
52
- if successful? && active_scaffold_config.update.refresh_list && !render_parent?
53
+ if successful? && update_refresh_list? && !render_parent?
53
54
  do_search if respond_to? :do_search
54
55
  do_list
55
56
  end
@@ -125,6 +126,11 @@ module ActiveScaffold::Actions
125
126
  # override this method if you want to do something after the save
126
127
  def after_update_save(record); end
127
128
 
129
+ # should we refresh whole list after update operation
130
+ def update_refresh_list?
131
+ active_scaffold_config.update.refresh_list
132
+ end
133
+
128
134
  # The default security delegates to ActiveRecordPermissions.
129
135
  # You may override the method to customize.
130
136
  def update_authorized?(record = nil)
@@ -298,8 +298,10 @@ module ActiveScaffold
298
298
  options.reject{|k, v| v.blank?}.inject(query) do |query, (k, v)|
299
299
  # default ordering of model has a higher priority than current queries ordering
300
300
  # fix this by removing existing ordering from arel
301
- # will not work if order part is first one which is iterated
302
- query = query.except(:order) if k.to_sym == :order && query.is_a?(ActiveRecord::Relation)
301
+ if k.to_sym == :order
302
+ query = query.where('1=1') unless query.is_a?(ActiveRecord::Relation)
303
+ query = query.except(:order)
304
+ end
303
305
  query.send((k.to_sym), v)
304
306
  end
305
307
  end
@@ -134,12 +134,12 @@ module ActiveScaffold
134
134
  def render_action_link(link, url_options, record = nil, html_options = {})
135
135
  url_options = action_link_url_options(link, url_options, record)
136
136
  html_options = action_link_html_options(link, url_options, record, html_options)
137
- action_link_html(link, url_options, html_options)
137
+ action_link_html(link, url_options, html_options, record)
138
138
  end
139
139
 
140
140
  def render_group_action_link(link, url_options, options, record = nil)
141
141
  if link.type == :member && !options[:authorized]
142
- action_link_html(link, nil, {:class => "disabled #{link.action}#{link.html_options[:class].blank? ? '' : (' ' + link.html_options[:class])}"})
142
+ action_link_html(link, nil, {:class => "disabled #{link.action}#{link.html_options[:class].blank? ? '' : (' ' + link.html_options[:class])}"}, record)
143
143
  else
144
144
  render_action_link(link, url_options, record)
145
145
  end
@@ -198,7 +198,7 @@ module ActiveScaffold
198
198
  action_link_id(action_id, id)
199
199
  end
200
200
 
201
- def action_link_html(link, url, html_options)
201
+ def action_link_html(link, url, html_options, record)
202
202
  # issue 260, use url_options[:link] if it exists. This prevents DB data from being localized.
203
203
  label = url.delete(:link) if url.is_a?(Hash)
204
204
  label ||= link.label
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 0
5
- PATCH = 17
5
+ PATCH = 18
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_vho
3
3
  version: !ruby/object:Gem::Version
4
- hash: 37
4
+ hash: 35
5
5
  prerelease: false
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
- - 17
10
- version: 3.0.17
9
+ - 18
10
+ version: 3.0.18
11
11
  platform: ruby
12
12
  authors:
13
13
  - Many, see README
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-14 00:00:00 +01:00
18
+ date: 2011-03-27 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency