cm-admin 1.2.5 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56179a4d588a2f01a6b817c6c2ad4adb47d3be819aa9ed2680fe1944d21fb807
4
- data.tar.gz: 624bc396f461879c5ff551e2a1105808a90fed770391805d8c197a3d6cc0d650
3
+ metadata.gz: befa5f5406ee5c883398ac3a1134ff865c403bcdd4ffbea17a0845b55e58f728
4
+ data.tar.gz: a14fc15107042c6763a518588c12f67f6e5de3efff11b4af833c3e0728a07e0e
5
5
  SHA512:
6
- metadata.gz: 04ae93d9491118e0cfe36d71035883af6b41ed04491fb654d4b0a422f0ea47c41f536778be308c9a9c01aeb891c91f2a075f294f671398135ebf6e8eaf9ba6c3
7
- data.tar.gz: 62d3ac65b2049a1361822b02a533eb18d7aa3e3ef836f1dee981642f639c8a678a95b8a5fcffcb089f1b7b47534e96fe5f85f2396ac0eff3915091d4f8459174
6
+ metadata.gz: d3e2b316707f6877476f0854b07d975a0ca5b5a6b594865227b2feea2b9c8569eb6338c567b7bf3b4aa08d7813897059619841e4ded430c505d9ccc508b6d606
7
+ data.tar.gz: ae93a4a2fabd6af3b99beae3a53e3b32fe05c4074f23230c6a8eff4157783806d274ccb8664e210c9baa301073da109612d6431c7618032382c783207fe49e27
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cm-admin (1.2.5)
4
+ cm-admin (1.2.7)
5
5
  caxlsx_rails
6
6
  cocoon (~> 1.2.15)
7
7
  csv-importer (~> 0.8.2)
@@ -15,12 +15,13 @@ class CmAdmin::BulkActionProcessor
15
15
  column_name = @model.available_fields[:index].first.field_name
16
16
  begin
17
17
  @current_action.code_block.call(id)
18
+ @error_message = nil
18
19
  rescue NoMethodError, NameError => e
19
20
  @error_message = "#{e.message.slice(0..(e.message.index(' for')))} at #{ar_object.send(column_name)}"
20
21
  rescue ActiveRecord::RecordInvalid => e
21
22
  @error_message = "#{e.message} at #{ar_object.send(column_name)}"
22
23
  rescue StandardError => e
23
- @error_message = e.message
24
+ @error_message = "#{ar_object.send(column_name)} - #{e.message}"
24
25
  end
25
26
  @invalid_records << OpenStruct.new({ row_identifier: ar_object.send(column_name), error_message: @error_message }) if @error_message
26
27
  end
@@ -1,3 +1,3 @@
1
1
  module CmAdmin
2
- VERSION = '1.2.5'
2
+ VERSION = '1.2.7'
3
3
  end
@@ -104,13 +104,15 @@ module CmAdmin
104
104
 
105
105
  def attachment_list(form_obj, cm_field, _value, required_class, _target_action)
106
106
  attached = form_obj.object.send(cm_field.field_name)
107
+ return if attached.instance_of?(Paperclip::Attachment)
108
+
107
109
  content_tag(:div) do
108
110
  if attached.class == ActiveStorage::Attached::Many
109
111
  attached.each do |attachment|
110
112
  concat attachment_with_icon(attachment)
111
113
  end
112
114
  else
113
- concat attachment_with_icon(attached)
115
+ concat attachment_with_icon(attached) if attached
114
116
  end
115
117
  end
116
118
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cm-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - sajinmp
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2023-10-12 00:00:00.000000000 Z
13
+ date: 2023-10-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails