measured-rails 2.5.2 → 2.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +38 -0
- data/CHANGELOG.md +28 -0
- data/README.md +10 -0
- data/dev.yml +1 -1
- data/gemfiles/{rails-5.0.gemfile → rails-5.2.gemfile} +1 -1
- data/gemfiles/rails-6.0.gemfile +1 -1
- data/gemfiles/{rails-5.1.gemfile → rails-6.1.gemfile} +1 -1
- data/gemfiles/{rails-master.gemfile → rails-edge.gemfile} +1 -1
- data/lib/measured/rails/active_record.rb +5 -1
- data/lib/measured/rails/version.rb +1 -1
- data/measured-rails.gemspec +11 -3
- data/test/active_record_test.rb +46 -48
- data/test/support/models/thing_with_custom_value_accessor.rb +19 -0
- data/test/support/schema.rb +18 -1
- data/test/validation_test.rb +5 -5
- metadata +19 -16
- data/.travis.yml +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7f5d42d6f68a07206f65244200601d778a45d98d2082fa6e3219ef6c0ef1d7a
|
4
|
+
data.tar.gz: f6c02b4a808080c43694621964947b92ed3a943edc2c474a016459890e3d8e5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fe858682b711f08f552b73c1cf0d2e56d7b89fa398ae7c36261178e7a1196e0f3e48e19e2104f263bc581c91b3e4a6c9a98a32f187f97818b4d503d98941b60
|
7
|
+
data.tar.gz: 7ed2063fe8249390a14c2bdd455f4d99aecc2b0a630bbb8ebd8334f3bcfe493e383512b6f994e47420bccbec45dfff4369aa0688c86bbe963a7d60b42b6c9709
|
@@ -0,0 +1,38 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
env:
|
9
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
10
|
+
strategy:
|
11
|
+
fail-fast: false
|
12
|
+
matrix:
|
13
|
+
ruby:
|
14
|
+
- '2.6'
|
15
|
+
- '2.7'
|
16
|
+
- '3.0'
|
17
|
+
gemfile:
|
18
|
+
- Gemfile
|
19
|
+
- gemfiles/rails-5.2.gemfile
|
20
|
+
- gemfiles/rails-6.0.gemfile
|
21
|
+
- gemfiles/rails-6.1.gemfile
|
22
|
+
- gemfiles/rails-edge.gemfile
|
23
|
+
exclude:
|
24
|
+
- ruby: '2.6'
|
25
|
+
gemfile: gemfiles/rails-edge.gemfile
|
26
|
+
- ruby: '3.0'
|
27
|
+
gemfile: gemfiles/rails-5.2.gemfile
|
28
|
+
name: Ruby ${{ matrix.ruby }} ${{ matrix.gemfile }}
|
29
|
+
steps:
|
30
|
+
- uses: actions/checkout@v1
|
31
|
+
- name: Set up Ruby ${{ matrix.ruby }}
|
32
|
+
uses: ruby/setup-ruby@v1
|
33
|
+
with:
|
34
|
+
ruby-version: ${{ matrix.ruby }}
|
35
|
+
bundler-cache: true
|
36
|
+
- name: Run tests
|
37
|
+
run: |
|
38
|
+
bundle exec rake
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,31 @@
|
|
1
|
+
Unreleased
|
2
|
+
-----
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
2.8.1
|
7
|
+
-----
|
8
|
+
|
9
|
+
* Bump measured to 2.8.1
|
10
|
+
|
11
|
+
2.8.0
|
12
|
+
-----
|
13
|
+
|
14
|
+
* Support setting a custom value field. (Thanks @Steffylicious)
|
15
|
+
* Drop support for Ruby 2.5
|
16
|
+
* Use Ruby 3.0.2 for development
|
17
|
+
|
18
|
+
2.7.1
|
19
|
+
-----
|
20
|
+
|
21
|
+
* Bump measured to 2.7.1
|
22
|
+
|
23
|
+
2.6.0
|
24
|
+
-----
|
25
|
+
|
26
|
+
* Only support Rails 5.2 and above.
|
27
|
+
|
28
|
+
|
1
29
|
2.5.2
|
2
30
|
-----
|
3
31
|
|
data/README.md
CHANGED
@@ -54,6 +54,16 @@ class ThingWithCustomUnitAccessor < ActiveRecord::Base
|
|
54
54
|
end
|
55
55
|
```
|
56
56
|
|
57
|
+
Similarly, you can optionally customize the model's value column by specifying it in the `value_field_name` option, as follows:
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
class ThingWithCustomValueAccessor < ActiveRecord::Base
|
61
|
+
measured_length :length, value_field_name: :custom_length
|
62
|
+
measured_weight :total_weight, value_field_name: :custom_weight
|
63
|
+
measured_volume :volume, value_field_name: :custom_volume
|
64
|
+
end
|
65
|
+
```
|
66
|
+
|
57
67
|
There are some simpler methods for predefined types:
|
58
68
|
|
59
69
|
```ruby
|
data/dev.yml
CHANGED
data/gemfiles/rails-6.0.gemfile
CHANGED
@@ -25,7 +25,11 @@ module Measured::Rails::ActiveRecord
|
|
25
25
|
"#{ field }_unit"
|
26
26
|
end
|
27
27
|
|
28
|
-
value_field_name =
|
28
|
+
value_field_name = if options[:value_field_name]
|
29
|
+
measured_fields[field][:value_field_name] = options[:value_field_name].to_s
|
30
|
+
else
|
31
|
+
"#{ field }_value"
|
32
|
+
end
|
29
33
|
|
30
34
|
# Reader to retrieve measured object
|
31
35
|
define_method(field) do
|
data/measured-rails.gemspec
CHANGED
@@ -13,6 +13,14 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = "https://github.com/Shopify/measured-rails"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
17
|
+
# delete this section to allow pushing this gem to any host.
|
18
|
+
if spec.respond_to?(:metadata)
|
19
|
+
spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
20
|
+
else
|
21
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
22
|
+
end
|
23
|
+
|
16
24
|
spec.files = `git ls-files -z`.split("\x0")
|
17
25
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
26
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
@@ -20,9 +28,9 @@ Gem::Specification.new do |spec|
|
|
20
28
|
|
21
29
|
spec.add_runtime_dependency "measured", Measured::Rails::VERSION
|
22
30
|
|
23
|
-
spec.add_runtime_dependency "railties", ">=
|
24
|
-
spec.add_runtime_dependency "activemodel", ">=
|
25
|
-
spec.add_runtime_dependency "activerecord", ">=
|
31
|
+
spec.add_runtime_dependency "railties", ">= 5.2"
|
32
|
+
spec.add_runtime_dependency "activemodel", ">= 5.2"
|
33
|
+
spec.add_runtime_dependency "activerecord", ">= 5.2"
|
26
34
|
|
27
35
|
spec.add_development_dependency "rake", "> 10.0"
|
28
36
|
spec.add_development_dependency "minitest", "> 5.5.1"
|
data/test/active_record_test.rb
CHANGED
@@ -196,109 +196,87 @@ class Measured::Rails::ActiveRecordTest < ActiveSupport::TestCase
|
|
196
196
|
assert_nil thing.length
|
197
197
|
end
|
198
198
|
|
199
|
-
test "
|
199
|
+
test "update sets one then the other" do
|
200
200
|
thing = Thing.create!
|
201
|
-
thing.
|
201
|
+
assert thing.update(width_value: 11.1)
|
202
202
|
assert_nil thing.width
|
203
|
-
|
204
|
-
|
205
|
-
test "update_attribute sets only the _unit column" do
|
206
|
-
thing = Thing.create!
|
207
|
-
thing.update_attribute(:width_unit, "cm")
|
208
|
-
assert_nil thing.width
|
209
|
-
end
|
210
|
-
|
211
|
-
test "update_attribute modifies the _value column" do
|
212
|
-
assert thing.update_attribute(:width_value, 99)
|
213
|
-
assert_equal Measured::Length.new(99, :in), thing.width
|
214
|
-
end
|
215
|
-
|
216
|
-
test "update_attribute modifies only the _unit column" do
|
217
|
-
assert thing.update_attribute(:width_unit, :cm)
|
218
|
-
assert_equal Measured::Length.new(6, :cm), thing.width
|
219
|
-
end
|
220
|
-
|
221
|
-
test "update_attribute sets one then the other" do
|
222
|
-
thing = Thing.create!
|
223
|
-
assert thing.update_attribute(:width_value, 11.1)
|
224
|
-
assert_nil thing.width
|
225
|
-
assert thing.update_attribute(:width_unit, "cm")
|
203
|
+
assert thing.update(width_unit: "cm")
|
226
204
|
assert_equal Measured::Length.new(11.1, :cm), thing.width
|
227
205
|
end
|
228
206
|
|
229
|
-
test "
|
207
|
+
test "update sets only the _value column" do
|
230
208
|
thing = Thing.create!
|
231
|
-
assert thing.
|
209
|
+
assert thing.update(width_value: "314")
|
232
210
|
assert_equal 314, thing.width_value
|
233
211
|
thing.reload
|
234
212
|
assert_equal 314, thing.width_value
|
235
213
|
assert_nil thing.width
|
236
214
|
end
|
237
215
|
|
238
|
-
test "
|
216
|
+
test "update sets only the _unit column" do
|
239
217
|
thing = Thing.create!
|
240
|
-
assert thing.
|
218
|
+
assert thing.update(width_unit: :cm)
|
241
219
|
assert_equal "cm", thing.width_unit
|
242
220
|
thing.reload
|
243
221
|
assert_equal "cm", thing.width_unit
|
244
222
|
assert_nil thing.width
|
245
223
|
end
|
246
224
|
|
247
|
-
test "
|
225
|
+
test "update sets only the _unit column and converts it" do
|
248
226
|
thing = Thing.create!
|
249
|
-
assert thing.
|
227
|
+
assert thing.update(width_unit: "inch")
|
250
228
|
assert_equal "in", thing.width_unit
|
251
229
|
thing.reload
|
252
230
|
assert_equal "in", thing.width_unit
|
253
231
|
end
|
254
232
|
|
255
|
-
test "
|
233
|
+
test "update sets the _unit column to something invalid" do
|
256
234
|
thing = Thing.create!
|
257
|
-
assert thing.
|
235
|
+
assert thing.update(width_unit: :invalid)
|
258
236
|
assert_equal "invalid", thing.width_unit
|
259
237
|
thing.reload
|
260
238
|
assert_equal "invalid", thing.width_unit
|
261
239
|
assert_nil thing.width
|
262
240
|
end
|
263
241
|
|
264
|
-
test "
|
242
|
+
test "update does not set the _unit column to something invalid if there is validation" do
|
265
243
|
thing = validated_thing
|
266
244
|
thing.save!
|
267
|
-
refute thing.
|
245
|
+
refute thing.update(length_unit: :invalid)
|
268
246
|
end
|
269
247
|
|
270
|
-
test "
|
248
|
+
test "update sets one column then the other" do
|
271
249
|
thing = Thing.create!
|
272
|
-
assert thing.
|
250
|
+
assert thing.update(width_unit: "inch")
|
273
251
|
assert_nil thing.width
|
274
|
-
assert thing.
|
252
|
+
assert thing.update(width_value: "314")
|
275
253
|
assert_equal Measured::Length.new(314, :in), thing.width
|
276
254
|
end
|
277
255
|
|
278
|
-
test "
|
256
|
+
test "update sets both columns" do
|
279
257
|
thing = Thing.create!
|
280
|
-
assert thing.
|
258
|
+
assert thing.update(width_unit: :cm, width_value: 2)
|
281
259
|
assert_equal Measured::Length.new(2, :cm), thing.width
|
282
260
|
thing.reload
|
283
261
|
assert_equal Measured::Length.new(2, :cm), thing.width
|
284
262
|
end
|
285
263
|
|
286
|
-
test "
|
287
|
-
assert thing.
|
264
|
+
test "update modifies the _value column" do
|
265
|
+
assert thing.update(height_value: 2)
|
288
266
|
assert_equal Measured::Length.new(2, :m), thing.height
|
289
267
|
thing.reload
|
290
268
|
assert_equal Measured::Length.new(2, :m), thing.height
|
291
269
|
end
|
292
270
|
|
293
|
-
test "
|
294
|
-
assert thing.
|
271
|
+
test "update modifies only the _unit column" do
|
272
|
+
assert thing.update(height_unit: "foot")
|
295
273
|
assert_equal Measured::Length.new(1, :ft), thing.height
|
296
274
|
thing.reload
|
297
275
|
assert_equal Measured::Length.new(1, :ft), thing.height
|
298
276
|
end
|
299
277
|
|
300
|
-
test "
|
301
|
-
assert thing.
|
278
|
+
test "update modifies the _unit column to be something invalid" do
|
279
|
+
assert thing.update(height_unit: :invalid)
|
302
280
|
assert_nil thing.height
|
303
281
|
assert_equal "invalid", thing.height_unit
|
304
282
|
thing.reload
|
@@ -306,8 +284,8 @@ class Measured::Rails::ActiveRecordTest < ActiveSupport::TestCase
|
|
306
284
|
assert_equal "invalid", thing.height_unit
|
307
285
|
end
|
308
286
|
|
309
|
-
test "
|
310
|
-
assert thing.
|
287
|
+
test "update modifies both columns" do
|
288
|
+
assert thing.update(height_unit: "mm", height_value: 1.23)
|
311
289
|
assert_equal Measured::Length.new(1.23, :mm), thing.height
|
312
290
|
thing.reload
|
313
291
|
assert_equal Measured::Length.new(1.23, :mm), thing.height
|
@@ -386,6 +364,15 @@ class Measured::Rails::ActiveRecordTest < ActiveSupport::TestCase
|
|
386
364
|
assert_equal custom_unit_thing.extra_weight, Measured::Weight.new(12, :kg)
|
387
365
|
end
|
388
366
|
|
367
|
+
test "using custom value fields works correctly" do
|
368
|
+
assert_equal custom_value_thing.length, Measured::Length.new(4, :m)
|
369
|
+
assert_equal custom_value_thing.width, Measured::Length.new(5, :m)
|
370
|
+
assert_equal custom_value_thing.height, Measured::Length.new(6, :m)
|
371
|
+
assert_equal custom_value_thing.volume, Measured::Volume.new(13, :l)
|
372
|
+
assert_equal custom_value_thing.total_weight, Measured::Weight.new(14, :g)
|
373
|
+
assert_equal custom_value_thing.extra_weight, Measured::Weight.new(15, :g)
|
374
|
+
end
|
375
|
+
|
389
376
|
private
|
390
377
|
|
391
378
|
def length
|
@@ -432,4 +419,15 @@ class Measured::Rails::ActiveRecordTest < ActiveSupport::TestCase
|
|
432
419
|
extra_weight: Measured::Weight.new(12, :g),
|
433
420
|
)
|
434
421
|
end
|
422
|
+
|
423
|
+
def custom_value_thing
|
424
|
+
@custom_value_thing ||= ThingWithCustomValueAccessor.new(
|
425
|
+
length: Measured::Length.new(4, :m),
|
426
|
+
width: Measured::Length.new(5, :m),
|
427
|
+
height: Measured::Length.new(6, :m),
|
428
|
+
volume: Measured::Volume.new(13, :l),
|
429
|
+
total_weight: Measured::Weight.new(14, :g),
|
430
|
+
extra_weight: Measured::Weight.new(15, :g),
|
431
|
+
)
|
432
|
+
end
|
435
433
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
class ThingWithCustomValueAccessor < ActiveRecord::Base
|
3
|
+
measured_length :length, value_field_name: :custom_length
|
4
|
+
validates :length, measured: true
|
5
|
+
measured_length :width, value_field_name: :custom_width
|
6
|
+
validates :width, measured: true
|
7
|
+
|
8
|
+
measured_volume :volume, value_field_name: :custom_volume
|
9
|
+
validates :volume, measured: true
|
10
|
+
|
11
|
+
measured_length :height, value_field_name: :custom_height
|
12
|
+
validates :height, measured: true
|
13
|
+
|
14
|
+
measured_weight :total_weight, value_field_name: :custom_weight
|
15
|
+
validates :total_weight, measured: true
|
16
|
+
|
17
|
+
measured_weight :extra_weight, value_field_name: :custom_extra_weight
|
18
|
+
validates :extra_weight, measured: true
|
19
|
+
end
|
data/test/support/schema.rb
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema.define(version:
|
13
|
+
ActiveRecord::Schema.define(version: 20211105120355) do
|
14
14
|
|
15
15
|
create_table "thing_with_custom_unit_accessors", force: :cascade do |t|
|
16
16
|
t.decimal "length_value", precision: 10, scale: 2
|
@@ -80,4 +80,21 @@ ActiveRecord::Schema.define(version: 20161118203701) do
|
|
80
80
|
t.string "length_numericality_less_than_than_scalar_unit", limit: 12
|
81
81
|
end
|
82
82
|
|
83
|
+
create_table "thing_with_custom_value_accessors", force: :cascade do |t|
|
84
|
+
t.decimal "custom_length", precision: 10, scale: 2
|
85
|
+
t.string "length_unit", limit: 12
|
86
|
+
t.decimal "custom_width", precision: 10, scale: 2
|
87
|
+
t.string "width_unit", limit: 12
|
88
|
+
t.decimal "custom_height", precision: 10, scale: 2
|
89
|
+
t.string "height_unit", limit: 12
|
90
|
+
t.decimal "custom_volume", precision: 10, scale: 2
|
91
|
+
t.string "volume_unit", limit: 12
|
92
|
+
t.decimal "custom_weight", precision: 10, scale: 2, default: "10.0"
|
93
|
+
t.string "total_weight_unit", limit: 12
|
94
|
+
t.decimal "custom_extra_weight", precision: 10, scale: 2
|
95
|
+
t.string "extra_weight_unit", limit: 12
|
96
|
+
t.datetime "created_at", null: false
|
97
|
+
t.datetime "updated_at", null: false
|
98
|
+
end
|
99
|
+
|
83
100
|
end
|
data/test/validation_test.rb
CHANGED
@@ -17,7 +17,7 @@ class Measured::Rails::ValidationTest < ActiveSupport::TestCase
|
|
17
17
|
test "validation fails when unit is nil" do
|
18
18
|
thing.length_unit = ''
|
19
19
|
refute thing.valid?
|
20
|
-
assert_equal({ length: "is not a valid unit" }, thing.errors.
|
20
|
+
assert_equal({ length: ["is not a valid unit"] }, thing.errors.to_hash)
|
21
21
|
end
|
22
22
|
|
23
23
|
test "validation fails on model with custom unit with nil value" do
|
@@ -25,11 +25,11 @@ class Measured::Rails::ValidationTest < ActiveSupport::TestCase
|
|
25
25
|
refute custom_unit_thing.valid?
|
26
26
|
assert_equal(
|
27
27
|
{
|
28
|
-
length: "is not a valid unit",
|
29
|
-
width: "is not a valid unit",
|
30
|
-
height: "is not a valid unit",
|
28
|
+
length: ["is not a valid unit"],
|
29
|
+
width: ["is not a valid unit"],
|
30
|
+
height: ["is not a valid unit"],
|
31
31
|
},
|
32
|
-
custom_unit_thing.errors.
|
32
|
+
custom_unit_thing.errors.to_hash
|
33
33
|
)
|
34
34
|
end
|
35
35
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: measured-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin McPhillips
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: measured
|
@@ -16,56 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.8.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.8.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: railties
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '5.2'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '5.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: activemodel
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '5.2'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '5.2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: activerecord
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '5.2'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '5.2'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -158,18 +158,18 @@ executables: []
|
|
158
158
|
extensions: []
|
159
159
|
extra_rdoc_files: []
|
160
160
|
files:
|
161
|
+
- ".github/workflows/ci.yml"
|
161
162
|
- ".gitignore"
|
162
|
-
- ".travis.yml"
|
163
163
|
- CHANGELOG.md
|
164
164
|
- Gemfile
|
165
165
|
- LICENSE
|
166
166
|
- README.md
|
167
167
|
- Rakefile
|
168
168
|
- dev.yml
|
169
|
-
- gemfiles/rails-5.
|
170
|
-
- gemfiles/rails-5.1.gemfile
|
169
|
+
- gemfiles/rails-5.2.gemfile
|
171
170
|
- gemfiles/rails-6.0.gemfile
|
172
|
-
- gemfiles/rails-
|
171
|
+
- gemfiles/rails-6.1.gemfile
|
172
|
+
- gemfiles/rails-edge.gemfile
|
173
173
|
- lib/measured-rails.rb
|
174
174
|
- lib/measured/rails/active_record.rb
|
175
175
|
- lib/measured/rails/base.rb
|
@@ -184,6 +184,7 @@ files:
|
|
184
184
|
- test/active_record_test.rb
|
185
185
|
- test/support/models/thing.rb
|
186
186
|
- test/support/models/thing_with_custom_unit_accessor.rb
|
187
|
+
- test/support/models/thing_with_custom_value_accessor.rb
|
187
188
|
- test/support/models/validated_thing.rb
|
188
189
|
- test/support/schema.rb
|
189
190
|
- test/test_helper.rb
|
@@ -191,7 +192,8 @@ files:
|
|
191
192
|
homepage: https://github.com/Shopify/measured-rails
|
192
193
|
licenses:
|
193
194
|
- MIT
|
194
|
-
metadata:
|
195
|
+
metadata:
|
196
|
+
allowed_push_host: https://rubygems.org
|
195
197
|
post_install_message:
|
196
198
|
rdoc_options: []
|
197
199
|
require_paths:
|
@@ -207,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
209
|
- !ruby/object:Gem::Version
|
208
210
|
version: '0'
|
209
211
|
requirements: []
|
210
|
-
rubygems_version: 3.
|
212
|
+
rubygems_version: 3.2.20
|
211
213
|
signing_key:
|
212
214
|
specification_version: 4
|
213
215
|
summary: Rails adaptor for measured
|
@@ -215,6 +217,7 @@ test_files:
|
|
215
217
|
- test/active_record_test.rb
|
216
218
|
- test/support/models/thing.rb
|
217
219
|
- test/support/models/thing_with_custom_unit_accessor.rb
|
220
|
+
- test/support/models/thing_with_custom_value_accessor.rb
|
218
221
|
- test/support/models/validated_thing.rb
|
219
222
|
- test/support/schema.rb
|
220
223
|
- test/test_helper.rb
|
data/.travis.yml
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
sudo: false
|
3
|
-
cache: bundler
|
4
|
-
rvm:
|
5
|
-
- 2.4.9
|
6
|
-
- 2.5.7
|
7
|
-
- 2.6.5
|
8
|
-
- 2.7.0
|
9
|
-
gemfile:
|
10
|
-
- Gemfile
|
11
|
-
- gemfiles/rails-5.0.gemfile
|
12
|
-
- gemfiles/rails-5.1.gemfile
|
13
|
-
- gemfiles/rails-6.0.gemfile
|
14
|
-
- gemfiles/rails-master.gemfile
|
15
|
-
matrix:
|
16
|
-
exclude:
|
17
|
-
- gemfile: gemfiles/rails-master.gemfile
|
18
|
-
rvm: 2.4.9
|
19
|
-
- gemfile: gemfiles/rails-6.0.gemfile
|
20
|
-
rvm: 2.4.9
|
21
|
-
allow_failures:
|
22
|
-
- gemfile: gemfiles/rails-master.gemfile
|