releaf-core 1.1.17 → 1.1.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/assets/javascripts/releaf/include/field.type_richtext.js +1 -0
- data/app/builders/releaf/builders/table_builder.rb +7 -0
- data/app/controllers/releaf/action_controller.rb +1 -0
- data/lib/generators/releaf/templates/initializers/releaf.rb +1 -1
- data/spec/builders/releaf/builders/table_builder_spec.rb +13 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 91aa700c381a592137619438ddadcdc25085116ac4ce63e88c2f777654cc0d84
|
4
|
+
data.tar.gz: 9567f19d96ccdf0cef621c78a18d9d2373180c9fb1b9991855d326657f78b82f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ddf798441fd24cd83d9f5c366bc887d9583f5c50c334e52c8d02218ee6d336bf4a85d425bf127a4a1ec14393601086ac0cf1d25856f6f57f834d8861ba6f87e
|
7
|
+
data.tar.gz: cd567fcc253fca73fe583df26b0c14418e31a98b956f0885ece3de9281f37dd20efc452adb148ea5868d5f2c6c9fd6629bae39b1c18f4c95fb2a64bcd6753153
|
@@ -174,6 +174,13 @@ class Releaf::Builders::TableBuilder
|
|
174
174
|
I18n.l(value, format: format) unless value.nil?
|
175
175
|
end
|
176
176
|
|
177
|
+
|
178
|
+
def format_time_content(resource, column)
|
179
|
+
value = column_value(resource, column)
|
180
|
+
format = Releaf::Builders::Utilities::DateFields.date_or_time_default_format(:time)
|
181
|
+
I18n.l(value, format: format) unless value.nil?
|
182
|
+
end
|
183
|
+
|
177
184
|
def format_association_content(resource, column)
|
178
185
|
format_string_content(resource, association_name(column))
|
179
186
|
end
|
@@ -457,6 +457,19 @@ describe Releaf::Builders::TableBuilder, type: :class do
|
|
457
457
|
end
|
458
458
|
end
|
459
459
|
|
460
|
+
describe "#format_time_content" do
|
461
|
+
it "returns localized time value" do
|
462
|
+
value = Time.parse("2012.12.29 17:12:07")
|
463
|
+
allow(subject).to receive(:column_value).with(resource, :created_at)
|
464
|
+
.and_return(value)
|
465
|
+
|
466
|
+
allow(I18n).to receive(:l).with(value, format: "%H:%M")
|
467
|
+
.and_return("17:12")
|
468
|
+
|
469
|
+
expect(subject.format_time_content(resource, :created_at)).to eq("17:12")
|
470
|
+
end
|
471
|
+
end
|
472
|
+
|
460
473
|
describe "#association_name" do
|
461
474
|
it "normalizes given column name by removing '_id' postfix and returning new value as symbol" do
|
462
475
|
expect(subject.association_name(:author_id)).to eq(:author)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: releaf-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CubeSystems
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -638,8 +638,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
638
638
|
- !ruby/object:Gem::Version
|
639
639
|
version: '0'
|
640
640
|
requirements: []
|
641
|
-
|
642
|
-
rubygems_version: 2.6.14
|
641
|
+
rubygems_version: 3.0.4
|
643
642
|
signing_key:
|
644
643
|
specification_version: 4
|
645
644
|
summary: core gem for releaf
|