active_scaffold 4.1.2 → 4.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15af74d3e088dff9881d6fe3e71f0831ff2c94ca0d01c5f464a669b81b9ec721
4
- data.tar.gz: e7128510f1e9037808bac0ad6076a13a950628aaa27ccb098a820dad93436ab9
3
+ metadata.gz: 7779c25b68085b6f9211742c807f90113cdd42c9397e3c60fea72e27ec0eb1ac
4
+ data.tar.gz: 0730c726da51cc31d08fc8081022e249224feddcca239d09d1a663da9a49fa0a
5
5
  SHA512:
6
- metadata.gz: 9607cb3e6ad4a1e1389a386673f4a9abda03f88e5a08f3d3cacce395cc6920189db2abf6cb724f45ed34b6ff68d57c6f2f3087e3069abd317541756da7ea248f
7
- data.tar.gz: 1b2c020b4214edab5f17b100a394017b5935e303dae967f1881650fe09cdf5fd4f27d726d6565f5e0b177c96335e776c0cf55255041fe00e6d7c1e4941f42693
6
+ metadata.gz: 205afed622c3b48938adc5baa75b8ca1e016ce4a959f5a60f539918f502d172f81d0c39b38bc4ea900ef37e49f7e5b6cb0bbb1c2d10122b3b72ec87a40075521
7
+ data.tar.gz: 21f01f191d84180b1b15ae54a3f4e9091fa9c088670105e6484a9ca641880c901e0aa803e4d0e38ec7d8a464a134a8826310a942981fd3b8447c094a128b8ef4
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,11 @@
1
+ - Fix dirty attributes on refresh_field action, record is built on unsaved instance copying attributes, but it reports only changed attributes from the form now
2
+ - Fix incompatibility with Rails renderable objects (ViewComponent, Turbo Streams)
3
+
4
+ = 4.1.3
5
+ - Columns using bitfields are not treated as number columns (e.g. don't get numeric class in list)
6
+ - Fix loading tinymce when the form is loaded on page load
7
+ - Speed up rendering action link with images, when list is long, image_path can be reused
8
+
1
9
  = 4.1.2
2
10
  - Call cache_column_counts in get_row, so custom code changing queries to calculate counts is used when a row is refreshed too
3
11
 
@@ -548,6 +548,7 @@
548
548
 
549
549
  window.ActiveScaffold = {
550
550
  last_focus: null,
551
+ setup_callbacks: [],
551
552
  setup: function(container) {
552
553
  /* setup some elements on page/form load */
553
554
  ActiveScaffold.load_embedded(container);
@@ -560,6 +561,7 @@
560
561
  if (container != document) {
561
562
  jQuery('[data-rs-type]', container).each(function() { RecordSelect.from_attributes(jQuery(this)); });
562
563
  }
564
+ ActiveScaffold.setup_callbacks.forEach(function(callback) { callback(container); });
563
565
  },
564
566
  setup_history_state: function() {
565
567
  if (!jQuery('.active-scaffold').length) return;
@@ -36,11 +36,8 @@
36
36
  jQuery(document).on('ajax:complete', 'form.as_form', function() {
37
37
  jQuery('textarea.mceEditor', this).each(loadTinyMCE);
38
38
  });
39
- /* enable tinymce textarea after form open */
40
- jQuery(document).on('as:action_success', 'a.as_action', function(event) {
41
- var action_link = ActiveScaffold.ActionLink.get(jQuery(this));
42
- if (action_link && action_link.adapter) {
43
- jQuery(action_link.adapter).find('textarea.mceEditor').each(loadTinyMCE);
44
- }
39
+ /* enable tinymce textarea after form open or page load */
40
+ ActiveScaffold.setup_callbacks.push(function(container) {
41
+ jQuery('textarea.mceEditor', container).each(loadTinyMCE);
45
42
  });
46
43
  })();
@@ -190,6 +190,7 @@ module ActiveScaffold::Actions
190
190
  def copy_attributes(orig, dst = nil)
191
191
  dst ||= orig.class.new
192
192
  orig.attributes.each { |attr, value| dst.send :write_attribute, attr, value }
193
+ dst.changes_applied
193
194
  dst
194
195
  end
195
196
 
@@ -6,11 +6,12 @@ module ActiveScaffold
6
6
  super
7
7
  return unless model.respond_to?(:bitfields) && model.bitfields.present?
8
8
 
9
- model.bitfields.each_value do |options|
9
+ model.bitfields.each do |column, options|
10
+ columns[column].number = false
10
11
  columns << options.keys
11
- options.each_key.with_index(1) do |column, i|
12
- columns[column].form_ui = :checkbox
13
- columns[column].weight = 1000 + i
12
+ options.each_key.with_index(1) do |bit_column, i|
13
+ columns[bit_column].form_ui = :checkbox
14
+ columns[bit_column].weight = 1000 + i
14
15
  end
15
16
  end
16
17
  end
@@ -36,6 +36,8 @@ module ActiveScaffold # :nodoc:
36
36
  # options[:xhr] force to load embedded scaffold with AJAX even when render_component gem is installed.
37
37
  #
38
38
  def render(*args, &)
39
+ return args.first.render_in(self) if args.one? && args.first.respond_to?(:render_in)
40
+
39
41
  if args.first.is_a?(Hash) && args.first[:active_scaffold]
40
42
  render_embedded args.first
41
43
  elsif args.first == :super
@@ -182,6 +184,8 @@ module ActionView
182
184
  # override the render method to use our @lookup_context instead of the
183
185
  # memoized @_lookup_context
184
186
  def render(options = {}, locals = {}, &block)
187
+ return options.render_in(self) if options.respond_to?(:render_in)
188
+
185
189
  case options
186
190
  when Hash
187
191
  in_rendering_context(options) do |_|
@@ -317,7 +317,8 @@ module ActiveScaffold
317
317
  def action_link_text(link, record, options)
318
318
  if link.image
319
319
  title = options[:link] || link.label(record)
320
- text = image_tag(link.image[:name], size: link.image[:size], alt: title, title: title)
320
+ asset = (@_link_images ||= {})[link.image[:name]] ||= image_path(link.image[:name])
321
+ text = image_tag(asset, size: link.image[:size], alt: title, title: title, skip_pipeline: true)
321
322
  end
322
323
  text || options[:link]
323
324
  end
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 4
4
4
  MINOR = 1
5
- PATCH = 2
5
+ PATCH = 4
6
6
  FIX = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, FIX].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.2
4
+ version: 4.1.4
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: 2025-10-17 00:00:00.000000000 Z
11
+ date: 2025-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dartsass-sprockets