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: 92aae53e06ad0e55d689420b7efd5d7bbeb506bde19cd5e32ef2a5157fb9e163
4
- data.tar.gz: 604eb816304b23dd82ca760192206d3b6e62a1cc188a647e5f8fb69589f99d6c
3
+ metadata.gz: c6f395bd97fb13e6ded5f85f0f5c3cd55d10ea38e157f1863f85b19290110ace
4
+ data.tar.gz: 934db7491402610d164055e6ef83ec81306e3771f482652563e126717df68774
5
5
  SHA512:
6
- metadata.gz: 435df01b39e8d571419743146b7941349f08d585505b4112d298fd670946e5565f5a78cbf595dcf699c7be809d5fac44e1e5f14a512d689a1cb85d0722b67d2c
7
- data.tar.gz: cb2d8876f0aa28df71309ae3f53f2e4542ce4dddc6a428dc5c19d1c58d733fbbcf03a3b9afb14ccef33cdf17d29d39c6532595f1eea6ed138a03f4de94260d71
6
+ metadata.gz: cb616008104648457e29e51654629458988c21452d256accfaf1921c4653b4e329807f56613a30e5cd9e26a9f7a3b5ca101227abd166f4f7b0670f357c781430
7
+ data.tar.gz: d8ca55f2ce6bf1d5742f724515a5aeaa55e88d9a021869f13e1573884e5b75582bdc9fbe964e215b1b6b715ad16032be6e240a42c9f1cec5addce5e09b85df75
@@ -42,7 +42,7 @@ module ActiveRemote
42
42
  if value.is_a?(String) && value.length > 50
43
43
  "#{value[0, 50]}...".inspect
44
44
  elsif value.is_a?(Date) || value.is_a?(Time)
45
- %("#{value.to_s(:db)}")
45
+ %("#{value.to_fs(:db)}")
46
46
  else
47
47
  value.inspect
48
48
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveRemote
2
- VERSION = "7.1.0"
2
+ VERSION = "7.1.1"
3
3
  end
@@ -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.0
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: 2024-12-05 00:00:00.000000000 Z
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