active_remote 7.1.0 → 7.1.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6f395bd97fb13e6ded5f85f0f5c3cd55d10ea38e157f1863f85b19290110ace
|
4
|
+
data.tar.gz: 934db7491402610d164055e6ef83ec81306e3771f482652563e126717df68774
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb616008104648457e29e51654629458988c21452d256accfaf1921c4653b4e329807f56613a30e5cd9e26a9f7a3b5ca101227abd166f4f7b0670f357c781430
|
7
|
+
data.tar.gz: d8ca55f2ce6bf1d5742f724515a5aeaa55e88d9a021869f13e1573884e5b75582bdc9fbe964e215b1b6b715ad16032be6e240a42c9f1cec5addce5e09b85df75
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe ::ActiveRemote::AttributeMethods do
|
4
|
+
describe "#attribute_for_inspect" do
|
5
|
+
it "returns the inspect-like string for the attribute" do
|
6
|
+
tag = Tag.new(guid: "derp")
|
7
|
+
expect(tag.attribute_for_inspect("guid")).to eq("derp".inspect)
|
8
|
+
end
|
9
|
+
|
10
|
+
context "when the attribute is a string longer than 50 characters" do
|
11
|
+
it "returns the inspect-like string for the attribute" do
|
12
|
+
tag = Tag.new(name: "The lazy yellow dog was caught by the slow red fox as he lay sleeping in the sun")
|
13
|
+
expect(tag.attribute_for_inspect("name")).to eq("The lazy yellow dog was caught by the slow red fox...".inspect)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
context "when the attribute is a Date" do
|
18
|
+
it "returns the inspect-like string in the :db format" do
|
19
|
+
value = Date.today
|
20
|
+
tag = Tag.new(updated_at: value)
|
21
|
+
expect(tag.attribute_for_inspect("updated_at")).to eq(%("#{value.to_fs(:db)}"))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
context "when the attribute is a Time" do
|
26
|
+
it "returns the inspect-like string in the :db format" do
|
27
|
+
value = Time.current
|
28
|
+
tag = Tag.new(updated_at: value)
|
29
|
+
expect(tag.attribute_for_inspect("updated_at")).to eq(%("#{value.to_fs(:db)}"))
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_remote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.1.
|
4
|
+
version: 7.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Hutchison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -224,6 +224,7 @@ files:
|
|
224
224
|
- lib/active_remote/validations.rb
|
225
225
|
- lib/active_remote/version.rb
|
226
226
|
- spec/lib/active_remote/association_spec.rb
|
227
|
+
- spec/lib/active_remote/attribute_methods_spec.rb
|
227
228
|
- spec/lib/active_remote/base_spec.rb
|
228
229
|
- spec/lib/active_remote/dirty_spec.rb
|
229
230
|
- spec/lib/active_remote/dsl_spec.rb
|