active_scaffold 3.3.1 → 3.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,10 @@
1
+ = 3.3.2
2
+ - Fix subforms inside subforms
3
+ - Fix draggable for jquery-rails 3 gem
4
+ - Support to change attributes in list column headings with column_heading_attributes helper
5
+ - Keep url for embedded in data-refresh attr of active-scaffold-component div
6
+ - Remove duplicated results when searching with outer_joins in plural associations
7
+
1
8
  = 3.3.1
2
9
  - Set adapter colspan (nested lists and forms) using javascript, fixed issue when active_scaffold_config_list is used
3
10
  - Fix bug saving default values when get method is overrided on model to return default value
@@ -7,6 +7,8 @@
7
7
  <% elsif Jquery.const_defined? 'Ui' %>
8
8
  <% require_asset "jquery.ui.core" %>
9
9
  <% require_asset "jquery.ui.sortable" %>
10
+ <% require_asset "jquery.ui.draggable" %>
11
+ <% require_asset "jquery.ui.droppable" %>
10
12
  <% require_asset "jquery.ui.datepicker" %>
11
13
  <% require_asset "jquery-ui-timepicker-addon" %>
12
14
  <% end %>
@@ -69,8 +69,8 @@ module ActionView::Helpers #:nodoc:
69
69
  if controller.respond_to?(:render_component_into_view, true)
70
70
  controller.send(:render_component_into_view, url_options)
71
71
  else
72
- content_tag(:div, :id => id, :class => 'active-scaffold-component') do
73
- url = url_for(url_options)
72
+ url = url_for(url_options)
73
+ content_tag(:div, :id => id, :class => 'active-scaffold-component', :data => {:refresh => url}) do
74
74
  # parse the ActiveRecord model name from the controller path, which
75
75
  # might be a namespaced controller (e.g., 'admin/admins')
76
76
  model = remote_controller.to_s.sub(/.*\//, '').singularize
@@ -344,7 +344,7 @@ module ActiveScaffold
344
344
 
345
345
  # NOTE: we must use :include in the count query, because some conditions may reference other tables
346
346
  count_query = append_to_query(beginning_of_chain, options)
347
- count = count_query.count
347
+ count = count_query.count(:distinct => true)
348
348
 
349
349
  # Converts count to an integer if ActiveRecord returned an OrderedHash
350
350
  # that happens when find_options contains a :group key
@@ -367,6 +367,7 @@ module ActiveScaffold
367
367
  end
368
368
 
369
369
  klass = beginning_of_chain
370
+ klass = klass.uniq if find_options[:outer_joins].present?
370
371
  # we build the paginator differently for method- and sql-based sorting
371
372
  if options[:sorting] and options[:sorting].sorts_by_method?
372
373
  pager = ::Paginator.new(count, options[:per_page]) do |offset, per_page|
@@ -415,7 +415,7 @@ module ActiveScaffold
415
415
  def column_scope(column, scope = nil, record = nil)
416
416
  Rails.logger.warn "Relying on @record is deprecated, call column_scope with record. Called from #{caller.first.gsub(/(.*:\d+):.*/, '\1')}" if record.nil? # TODO Remove when relying on @record is removed
417
417
  if column.plural_association?
418
- "#{scope}[#{column.name}][#{record.id || generate_temporary_id}]"
418
+ "#{scope}[#{column.name}][#{record.id || generate_temporary_id(record)}]"
419
419
  else
420
420
  "#{scope}[#{column.name}]"
421
421
  end
@@ -279,8 +279,12 @@ module ActiveScaffold
279
279
  content_tag(:span, check_box_tag("#{controller_id}_mark_heading_span_input", '1', all_marked?), tag_options)
280
280
  end
281
281
 
282
- def render_column_heading(column, sorting, sort_direction)
282
+ def column_heading_attributes(column, sorting, sort_direction)
283
283
  tag_options = {:id => active_scaffold_column_header_id(column), :class => column_heading_class(column, sorting), :title => strip_tags(column.description)}
284
+ end
285
+
286
+ def render_column_heading(column, sorting, sort_direction)
287
+ tag_options = column_heading_attributes(column, sorting, sort_direction)
284
288
  if column.name == :as_marked
285
289
  tag_options[:data] = {
286
290
  :ie_mode => :inline_checkbox,
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 3
5
- PATCH = 1
5
+ PATCH = 2
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
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 3
9
- - 1
10
- version: 3.3.1
9
+ - 2
10
+ version: 3.3.2
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: 2013-06-24 00:00:00 Z
18
+ date: 2013-07-04 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  type: :development