satis 1.0.69 → 1.0.70

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: 4d67068f1fbf018ab9c608056352d81b6dac55a162f7d81da49ea7053ae46fbc
4
- data.tar.gz: 91f4663daf88672d435d705d6452316309fcb8bebc3f32f0560a41f9c372973f
3
+ metadata.gz: 03c106e3c85f9b929d8857c93d5b3453f306f0c9557d1cc084dd763dd2bd849b
4
+ data.tar.gz: e0e8799e598ac7e0f8825a88194125df5ff140c425c751438f7971f1bb7857d9
5
5
  SHA512:
6
- metadata.gz: 1e5a801b78f3494ac01c060ddb06f1abeb99c1c3facd288e04fb39f13e56f34126182778bd0fc91d986bbd7ea90a6a7e565cd3a584395928641cf8769ba49c8d
7
- data.tar.gz: db160debfab9a8036df9b6522abbe047c61a48a1e57dbc3fc139d96c539786d5e293f21cab71311bdc90f0022db1c4b46f561d04ec8a0e26169ca16ba4cb5eca
6
+ metadata.gz: 73c6b212d40768e612fba5f20870fc99fdb0c544095d8aee622ae76ea0addb833ce361404e2be1c2bd74e288afd50ca8f1f9318cb0ce3bef992c90c7004975e3
7
+ data.tar.gz: '08a42c0b640f4f6fe1223d7e1ec046b91ae0cdae1fcf98146efbf6e82b0e180e011c0962d617ace24162cd46225a671ab06e955e6eb062eb47092a3b7eb5480d'
@@ -4,4 +4,4 @@
4
4
  dd.text-sm.text-gray-900.dark:text-gray-300
5
5
  - if options[:icon]
6
6
  i.mr-1 class=options[:icon]
7
- = content || options[:content] || @placeholder
7
+ = content || string_contents
@@ -14,6 +14,28 @@ module Satis
14
14
  @icon = options[:icon]
15
15
  @placeholder = options[:placeholder] || '—'
16
16
  end
17
+
18
+ def string_contents
19
+ @content = options[:content]
20
+ @content = @content.call if @content.respond_to?(:call)
21
+
22
+ case @content.presence
23
+ when Time
24
+ @content.strftime('%Y-%m-%d %H:%M')
25
+ when ActiveRecord::Base
26
+ @content.try(:human_name) || @content.try(:name) || "#{@content.class} ##{@content.id}"
27
+ when Symbol
28
+ @content.to_s.humanize
29
+ when ActiveSupport::SafeBuffer
30
+ @content
31
+ when String
32
+ @content.humanize
33
+ when nil
34
+ @placeholder
35
+ else
36
+ @content
37
+ end
38
+ end
17
39
  end
18
40
  end
19
41
  end
data/lib/satis/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Satis
2
- VERSION = "1.0.69"
2
+ VERSION = "1.0.70"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: satis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.69
4
+ version: 1.0.70
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom de Grunt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-22 00:00:00.000000000 Z
11
+ date: 2023-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: browser
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: strong_migrations
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.4'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.4'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: auxilium
71
85
  requirement: !ruby/object:Gem::Requirement