superstore 2.5.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69f3fe9607d8df59438f381a38fa0068f7a7435666bc1a79588cbe5914896b59
4
- data.tar.gz: 7da54acc35f5126576c35e6574e41b7cffd0eca9221ce5784948471eababe617
3
+ metadata.gz: 4b50e7d651ea05c7214a0407aca4c530eee09f8ba6e8d867d636400f1a22bb42
4
+ data.tar.gz: 00d665bc855ad9cfcdf77ceaaefb6d674a5964611eb082ea0e0e0d0da880ac84
5
5
  SHA512:
6
- metadata.gz: c7dcb613c89611211e5610bd991156e6ee4fb5f5e0f87f4f0b820ca1ed6555a26de8d618c7da14efa5b10dce9ae5b43aa732ee51d81ca8603be88bd231e63052
7
- data.tar.gz: db48bc7c88e0ab91dcc376f212b866556f0189b52841aa6491ff5a71dba83b4eaaae4e9b74c57ff759d42b6a20954571265979ea7d854de118dff589803a59e4
6
+ metadata.gz: d819bb08f1c070d18bdccd76caf941718947ea0c85191813f8896bc86d6c61d49f4306e3cea816514e05e635299d28bd663bc4515bb1ca90ae01bd7454db49bc
7
+ data.tar.gz: 014e964e51adb9c2791af3598435e6f7764b9e6bc80edab030f804c84944213eb68e423d7e9daf527f42c92ed98fa7da4421be5f55e4f1a315fb13904dfe3921
@@ -0,0 +1,40 @@
1
+ name: Ruby
2
+ on:
3
+ push:
4
+ branches: [ master ]
5
+ pull_request:
6
+ branches: [ master ]
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-20.04
10
+ strategy:
11
+ matrix:
12
+ ruby: ['3.1']
13
+ env:
14
+ CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
15
+ services:
16
+ postgres:
17
+ image: postgres:12.8
18
+ options: >-
19
+ --health-cmd pg_isready
20
+ --health-interval 10s
21
+ --health-timeout 5s
22
+ --health-retries 5
23
+ ports:
24
+ - 5432:5432
25
+ env:
26
+ POSTGRES_USER: runner
27
+ POSTGRES_HOST_AUTH_METHOD: trust
28
+ steps:
29
+ - name: Checkout the repo
30
+ uses: actions/checkout@v2
31
+ - name: Install Ruby, bundler and the bundle
32
+ uses: ruby/setup-ruby@v1
33
+ with:
34
+ ruby-version: ${{ matrix.ruby }}
35
+ bundler-cache: true
36
+ - name: Run tests
37
+ run: bundle exec rake
38
+ - name: Publish code coverage
39
+ if: ${{ github.actor != 'dependabot[bot]' }}
40
+ uses: paambaati/codeclimate-action@v3.0.0
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  .bundle
2
2
  Gemfile*.lock
3
3
  *.gem
4
+ coverage
data/.simplecov ADDED
@@ -0,0 +1,3 @@
1
+ SimpleCov.start 'test_frameworks' do
2
+ enable_coverage :branch
3
+ end
data/Gemfile CHANGED
@@ -1,10 +1,10 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
- gem 'rails', '~> 5.2.3'
5
4
  gem 'rake'
6
5
 
7
6
  group :test do
8
7
  gem 'pg'
9
8
  gem 'mocha', require: false
9
+ gem 'simplecov'
10
10
  end
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Koziarski Software Ltd
1
+ Copyright (c) 2009 Koziarski Software Ltd, 2022 Data Axle Inc
2
2
 
3
3
  Permission to use, copy, modify, and/or distribute this software for any
4
4
  purpose with or without fee is hereby granted, provided that the above
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011 [Michael Koziarski]
1
+ Copyright (c) 2011 [Michael Koziarski], 2022 [Data Axle Inc]
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Superstore
2
- [![Build Status](https://travis-ci.org/data-axle/superstore.svg?branch=master)](http://travis-ci.org/data-axle/superstore)
2
+ [![Ruby](https://github.com/data-axle/superstore/actions/workflows/ruby.yml/badge.svg)](https://github.com/data-axle/superstore/actions/workflows/ruby.yml)
3
3
  [![Code Climate](https://codeclimate.com/github/data-axle/superstore/badges/gpa.svg)](https://codeclimate.com/github/data-axle/superstore)
4
4
  [![Gem](https://img.shields.io/gem/v/superstore.svg?maxAge=2592000)](https://rubygems.org/gems/superstore)
5
5
 
@@ -35,4 +35,4 @@ module Superstore::Associations::Builder
35
35
  end
36
36
  end
37
37
  end
38
- end
38
+ end
@@ -18,7 +18,7 @@ module Superstore
18
18
  # end
19
19
  # class Truck < Superstore::Base
20
20
  # end
21
- def belongs_to(name, options = {})
21
+ def belongs_to(name, **options)
22
22
  if options.delete(:superstore)
23
23
  Superstore::Associations::Builder::BelongsTo.build(self, name, options)
24
24
  else
@@ -26,7 +26,7 @@ module Superstore
26
26
  end
27
27
  end
28
28
 
29
- def has_many(name, options = {})
29
+ def has_many(name, **options)
30
30
  if options.delete(:superstore)
31
31
  Superstore::Associations::Builder::HasMany.build(self, name, options)
32
32
  else
@@ -34,7 +34,7 @@ module Superstore
34
34
  end
35
35
  end
36
36
 
37
- def has_one(name, options = {})
37
+ def has_one(name, **options)
38
38
  if options.delete(:superstore)
39
39
  Superstore::Associations::Builder::HasOne.build(self, name, options)
40
40
  else
@@ -2,8 +2,6 @@ require 'superstore/types'
2
2
 
3
3
  module Superstore
4
4
  class Base < ActiveRecord::Base
5
-
6
- self.connection_specification_name = 'primary'
7
5
  self.abstract_class = true
8
6
  include Core
9
7
  include Persistence
@@ -11,7 +9,6 @@ module Superstore
11
9
  include AttributeAssignment
12
10
  include Attributes
13
11
  include AttributeMethods
14
- include Timestamp
15
12
  include Associations
16
13
 
17
14
  include Identity
@@ -19,25 +19,6 @@ module Superstore
19
19
  adapter.update table_name, id, serialize_attributes(attributes)
20
20
  end
21
21
 
22
- if Rails.version >= '6.0'
23
- def instantiate_instance_of(klass, attributes, column_types = {}, &block)
24
- if attributes[superstore_column].is_a?(String)
25
- attributes = JSON.parse(attributes[superstore_column]).merge('id' => attributes['id'])
26
- end
27
-
28
- super(klass, attributes, column_types, &block)
29
- end
30
- private :instantiate_instance_of
31
- else
32
- def instantiate(attributes, column_types = {}, &block)
33
- if attributes[superstore_column].is_a?(String)
34
- attributes = JSON.parse(attributes[superstore_column]).merge('id' => attributes['id'])
35
- end
36
-
37
- super(attributes, column_types, &block)
38
- end
39
- end
40
-
41
22
  def serialize_attributes(attributes)
42
23
  serialized = {}
43
24
  attributes.each do |attr_name, value|
@@ -49,6 +30,20 @@ module Superstore
49
30
 
50
31
  private
51
32
 
33
+ def instantiate_instance_of(klass, attributes, column_types = {}, &block)
34
+ if attributes[superstore_column].is_a?(String)
35
+ attributes = JSON.parse(attributes[superstore_column]).merge('id' => attributes['id'])
36
+ end
37
+
38
+ if inheritance_column && attribute_types.key?(inheritance_column)
39
+ klass = find_sti_class(attributes[inheritance_column])
40
+ end
41
+
42
+ attributes.each_key { |k, v| attributes.delete(k) unless klass.attribute_types.key?(k) }
43
+
44
+ super(klass, attributes, column_types, &block)
45
+ end
46
+
52
47
  def adapter
53
48
  @adapter ||= Superstore::Adapters::JsonbAdapter.new
54
49
  end
@@ -1,6 +1,6 @@
1
1
  module Superstore
2
2
  module Types
3
- class ArrayType < ActiveModel::Type::Value
3
+ class ArrayType < Base
4
4
  def cast_value(value)
5
5
  Array(value)
6
6
  end
@@ -0,0 +1,9 @@
1
+ module Superstore
2
+ module Types
3
+ class Base < ActiveModel::Type::Value
4
+ def type
5
+ self.class.name.demodulize.sub(/Type$/, '').underscore
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,6 +1,6 @@
1
1
  module Superstore
2
2
  module Types
3
- class BooleanType < ActiveModel::Type::Value
3
+ class BooleanType < Base
4
4
  TRUE_VALS = [true, 'true', '1']
5
5
  FALSE_VALS = [false, 'false', '0']
6
6
 
@@ -1,6 +1,6 @@
1
1
  module Superstore
2
2
  module Types
3
- class DateType < ActiveModel::Type::Value
3
+ class DateType < Base
4
4
  FORMAT = '%Y-%m-%d'
5
5
 
6
6
  def serialize(value)
@@ -1,6 +1,6 @@
1
1
  module Superstore
2
2
  module Types
3
- class FloatType < ActiveModel::Type::Value
3
+ class FloatType < Base
4
4
  def cast_value(value)
5
5
  Float(value) rescue nil
6
6
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Superstore
4
4
  module Types
5
- class GeoPointType < ActiveModel::Type::Value
5
+ class GeoPointType < Base
6
6
  def deserialize(value)
7
7
  {lat: value[:lat] || value['lat'], lon: value[:lon] || value['lon']} if value
8
8
  end
@@ -4,16 +4,12 @@ module Superstore
4
4
  self.subtype = IntegerType.new
5
5
 
6
6
  def serialize_for_open_ended(value)
7
- value.abs == Float::INFINITY ? nil : super
7
+ value&.abs == Float::INFINITY ? nil : super
8
8
  end
9
9
 
10
10
  def convert_min(method, value)
11
11
  value.nil? ? -Float::INFINITY : super
12
12
  end
13
-
14
- def convert_max(method, value)
15
- value.nil? ? Float::INFINITY : super
16
- end
17
13
  end
18
14
  end
19
15
  end
@@ -1,6 +1,6 @@
1
1
  module Superstore
2
2
  module Types
3
- class IntegerType < ActiveModel::Type::Value
3
+ class IntegerType < Base
4
4
  def cast_value(value)
5
5
  if value.is_a?(String)
6
6
  Integer(value, 10)
@@ -1,6 +1,6 @@
1
1
  module Superstore
2
2
  module Types
3
- class JsonType < ActiveModel::Type::Value
3
+ class JsonType < Base
4
4
  end
5
5
  end
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module Superstore
2
2
  module Types
3
- class RangeType < ActiveModel::Type::Value
3
+ class RangeType < Base
4
4
  class_attribute :subtype
5
5
 
6
6
  def serialize(range)
@@ -22,12 +22,14 @@ module Superstore
22
22
  end
23
23
 
24
24
  def cast_value(value)
25
- if value.is_a?(Range) && value.begin < value.end
25
+ if is_beginless_date_range?(value)
26
+ nil
27
+ elsif value.is_a?(Range) && (value.end.nil? || value.begin <= value.end)
26
28
  value
27
29
  elsif value.is_a?(Array) && value.size == 2
28
30
  begin
29
- array = convert_min(:cast_value, value[0])..convert_max(:cast_value, value[1])
30
- cast_value(array)
31
+ range = convert_min(:cast_value, value[0])..convert_max(:cast_value, value[1])
32
+ cast_value(range)
31
33
  rescue ArgumentError
32
34
  end
33
35
  end
@@ -46,6 +48,11 @@ module Superstore
46
48
  def convert_max(method, value)
47
49
  subtype.send(method, value)
48
50
  end
51
+
52
+ def is_beginless_date_range?(value)
53
+ (value.is_a?(Range) && value.begin.nil? && value.end.is_a?(Date)) ||
54
+ (value.is_a?(Array) && value[0].nil? && value[1].is_a?(Date))
55
+ end
49
56
  end
50
57
  end
51
58
  end
@@ -1,6 +1,6 @@
1
1
  module Superstore
2
2
  module Types
3
- class StringType < ActiveModel::Type::Value
3
+ class StringType < Base
4
4
  def serialize(str)
5
5
  return if str.nil?
6
6
 
@@ -1,6 +1,6 @@
1
1
  module Superstore
2
2
  module Types
3
- class TimeType < ActiveModel::Type::Value
3
+ class TimeType < Base
4
4
  def serialize(time)
5
5
  time.utc.xmlschema(6) if time
6
6
  end
data/lib/superstore.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'active_support/all'
2
2
  require 'active_model'
3
3
  require 'active_record'
4
- require 'global_id/identification'
5
4
 
6
5
  module Superstore
7
6
  extend ActiveSupport::Autoload
@@ -17,7 +16,6 @@ module Superstore
17
16
  autoload :Inheritance
18
17
  autoload :ModelSchema
19
18
  autoload :Persistence
20
- autoload :Timestamp
21
19
 
22
20
  module AttributeMethods
23
21
  extend ActiveSupport::Autoload
@@ -63,6 +61,7 @@ module Superstore
63
61
  module Types
64
62
  extend ActiveSupport::Autoload
65
63
 
64
+ autoload :Base
66
65
  autoload :ArrayType
67
66
  autoload :BooleanType
68
67
  autoload :DateType
data/superstore.gemspec CHANGED
@@ -1,27 +1,24 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
1
  Gem::Specification.new do |s|
4
2
  s.name = 'superstore'
5
- s.version = '2.5.0'
3
+ s.version = '3.0.0'
6
4
  s.description = 'ActiveModel-based JSONB document store'
7
5
  s.summary = 'ActiveModel for JSONB documents'
8
- s.authors = ['Michael Koziarski', 'Infogroup']
6
+ s.authors = ['Michael Koziarski', 'Data Axle']
9
7
  s.email = 'developer@matthewhiggins.com'
10
8
  s.homepage = 'http://github.com/data-axle/superstore'
11
- s.licenses = %w(ISC MIT)
9
+ s.licenses = %w[ISC MIT]
12
10
 
13
- s.required_ruby_version = '>= 2.0.0'
14
- s.required_rubygems_version = '>= 1.3.5'
11
+ s.required_ruby_version = '>= 3.0.0'
12
+ s.required_rubygems_version = '>= 3.2.0'
15
13
 
16
14
  s.extra_rdoc_files = ['README.md']
17
15
  s.files = `git ls-files`.split("\n")
18
16
  s.test_files = `git ls-files -- {test}/*`.split("\n")
19
17
  s.require_paths = ['lib']
20
18
 
21
- s.add_runtime_dependency('activemodel', '>= 5.2')
22
- s.add_runtime_dependency('activerecord', '>= 5.2')
23
- s.add_runtime_dependency('globalid')
19
+ s.add_runtime_dependency('activemodel', '>= 6.1')
20
+ s.add_runtime_dependency('activerecord', '>= 6.1')
24
21
 
25
22
  s.add_development_dependency('bundler')
26
- s.add_development_dependency('rails')
23
+ s.add_development_dependency('rails', '~> 6.1')
27
24
  end
@@ -10,6 +10,8 @@ class Issue < Superstore::Base
10
10
  attribute :title, type: :string
11
11
  attribute :parent_issue_id, type: :string
12
12
  attribute :comments, type: :json
13
+ attribute :created_at, type: :time
14
+ attribute :updated_at, type: :time
13
15
 
14
16
  before_create { self.description ||= 'funny' }
15
17
 
data/test/test_helper.rb CHANGED
@@ -1,3 +1,6 @@
1
+ ENV['RAILS_ENV'] = 'test'
2
+ require 'simplecov'
3
+
1
4
  require 'rails'
2
5
 
3
6
  I18n.config.enforce_available_locales = false
@@ -5,7 +8,7 @@ ActiveSupport::TestCase.test_order = :random
5
8
 
6
9
  require 'active_record'
7
10
  require 'rails/test_help'
8
- require 'mocha/setup'
11
+ require 'mocha/api'
9
12
 
10
13
  require 'superstore'
11
14
 
@@ -13,10 +16,6 @@ require 'support/pg'
13
16
  require 'support/jsonb'
14
17
  require 'support/models'
15
18
 
16
- def MiniTest.filter_backtrace(bt)
17
- bt
18
- end
19
-
20
19
  module Superstore
21
20
  class TestCase < ActiveSupport::TestCase
22
21
  def temp_object(&block)
@@ -37,6 +36,7 @@ module Superstore
37
36
  module Types
38
37
  class TestCase < Superstore::TestCase
39
38
  attr_accessor :type
39
+
40
40
  setup do
41
41
  @type = self.class.name.sub(/Test$/, '').constantize.new
42
42
  end
@@ -70,9 +70,9 @@ class Superstore::AttributesTest < Superstore::TestCase
70
70
 
71
71
  test 'integer_range' do
72
72
  issue = TestIssue.create! age_range: ['70', nil]
73
- assert_equal 70..Float::INFINITY, issue.age_range
73
+ assert_equal 70.., issue.age_range
74
74
 
75
75
  issue = TestIssue.find issue.id
76
- assert_equal 70..Float::INFINITY, issue.age_range
76
+ assert_equal 70.., issue.age_range
77
77
  end
78
78
  end
@@ -40,6 +40,11 @@ class Superstore::CoreTest < Superstore::TestCase
40
40
 
41
41
  test 'inspect' do
42
42
  issue = Issue.create
43
- assert issue.inspect =~ /^#<Issue id: \"\w+\", created_at: \".+\", updated_at: \".+\", description: \".+\">$/
43
+ assert issue.inspect =~ /^#<Issue id: \"\w+\", description: \".+\", created_at: \".+\", updated_at: \".+\">$/
44
+ end
45
+
46
+ test 'inspect class' do
47
+ expected = "Issue(id: string, description: string, title: string, parent_issue_id: string, comments: json, created_at: time, updated_at: time)"
48
+ assert_equal expected, Issue.inspect
44
49
  end
45
50
  end
@@ -4,8 +4,37 @@
4
4
  require 'test_helper'
5
5
 
6
6
  class Superstore::PersistenceTest < Superstore::TestCase
7
+ class Parent < Superstore::Base
8
+ self.inheritance_column = 'document_type'
9
+ attribute :document_type, type: :string
10
+
11
+ def self.find_sti_class(type)
12
+ Child
13
+ end
14
+ end
15
+
16
+ class Child < Parent
17
+ attribute :eye_color, type: :string
18
+ end
19
+
7
20
  test 'instantiate with unknowns' do
8
- assert_equal 'nooo', Issue.instantiate('id' => 'theid', 'document' => {'z' => 'nooo'}.to_json).attributes['z']
21
+ issue = Issue.instantiate('id' => 'theid', 'document' => {'z' => 'nooo', 'title' => 'Krazy'}.to_json)
22
+
23
+ refute issue.attributes.key?('z')
24
+ assert_equal 'Krazy', issue.attributes['title']
25
+ end
26
+
27
+ test 'instantiate with an inheritance column' do
28
+ child = Parent.instantiate('id' => 'theid', 'document' => {'document_type' => 'child', 'eye_color' => 'blue'}.to_json)
29
+
30
+ assert_kind_of Child, child
31
+ assert_equal 'blue', child.eye_color
32
+ end
33
+
34
+ test 'instantiate when an inheritance column is expected but is nil' do
35
+ child = Parent.instantiate('id' => 'theid', 'document' => { }.to_json)
36
+
37
+ assert_kind_of Child, child
9
38
  end
10
39
 
11
40
  test 'persistence inquiries' do
@@ -16,12 +16,13 @@ class Superstore::Types::DateRangeTypeTest < Superstore::Types::TestCase
16
16
 
17
17
  test 'cast_value' do
18
18
  assert_equal Date.new(2004, 4, 25)..Date.new(2004, 5, 15), type.cast_value(Date.new(2004, 4, 25)..Date.new(2004, 5, 15))
19
- assert_nil type.cast_value(Date.new(2004, 5, 15)..Date.new(2004, 4, 25))
20
19
  assert_equal Date.new(2004, 4, 25)..Date.new(2004, 5, 15), type.cast_value([Date.new(2004, 4, 25), Date.new(2004, 5, 15)])
21
- assert_nil type.cast_value([Date.new(2004, 5, 15), Date.new(2004, 4, 25)])
22
20
  assert_equal Date.new(2004, 4, 25)..Date.new(2004, 5, 15), type.cast_value(["2004-04-25", "2004-05-15"])
21
+ assert_equal Date.new(2004, 4, 25)..Date.new(2004, 4, 25), type.cast_value(["2004-04-25", "2004-04-25"])
22
+ assert_equal Date.new(2004, 4, 25).., type.cast_value(["2004-04-25", nil])
23
23
 
24
- assert_nil type.cast_value(["2004-04-25", nil])
24
+ assert_nil type.cast_value( Date.new(2004, 5, 15)..Date.new(2004, 4, 25))
25
+ assert_nil type.cast_value([Date.new(2004, 5, 15), Date.new(2004, 4, 25)])
25
26
  assert_nil type.cast_value([nil, "2004-05-15"])
26
27
  assert_nil type.cast_value(["xx", "2004-05-15"])
27
28
  end
@@ -21,4 +21,8 @@ class Superstore::Types::GeoPointTypeTest < Superstore::Types::TestCase
21
21
  assert_nil type.cast_value([])
22
22
  assert_nil type.cast_value('invalid')
23
23
  end
24
+
25
+ test 'type' do
26
+ assert_equal 'geo_point', type.type
27
+ end
24
28
  end
@@ -3,17 +3,17 @@ require 'test_helper'
3
3
  class Superstore::Types::IntegerRangeTypeTest < Superstore::Types::TestCase
4
4
  test 'serialize' do
5
5
  assert_equal [4, 5], type.serialize(4..5)
6
- assert_equal [4, nil], type.serialize(4..Float::INFINITY)
6
+ assert_equal [4, nil], type.serialize(4..)
7
7
  assert_equal [nil, 5], type.serialize(-Float::INFINITY..5)
8
- assert_equal [nil, nil], type.serialize(-Float::INFINITY..Float::INFINITY)
8
+ assert_equal [nil, nil], type.serialize(-Float::INFINITY..)
9
9
  end
10
10
 
11
11
  test 'deserialize' do
12
12
  assert_equal 4..5, type.deserialize([4, 5])
13
13
  assert_nil type.deserialize([5, 4])
14
- assert_equal 4..Float::INFINITY, type.deserialize([4, nil])
14
+ assert_equal 4.., type.deserialize([4, nil])
15
15
  assert_equal (-Float::INFINITY..5), type.deserialize([nil, 5])
16
- assert_equal (-Float::INFINITY..Float::INFINITY), type.deserialize([nil, nil])
16
+ assert_equal (-Float::INFINITY..), type.deserialize([nil, nil])
17
17
  end
18
18
 
19
19
  test 'cast_value' do
@@ -21,8 +21,8 @@ class Superstore::Types::IntegerRangeTypeTest < Superstore::Types::TestCase
21
21
  assert_nil type.cast_value(5..1)
22
22
  assert_equal 1..5, type.cast_value([1, 5])
23
23
  assert_nil type.cast_value([5, 1])
24
- assert_equal 1..Float::INFINITY, type.cast_value([1, nil])
24
+ assert_equal 1.., type.cast_value([1, nil])
25
25
  assert_equal (-Float::INFINITY..2), type.cast_value([nil, 2])
26
- assert_equal (-Float::INFINITY..Float::INFINITY), type.cast_value([nil, nil])
26
+ assert_equal (-Float::INFINITY..), type.cast_value([nil, nil])
27
27
  end
28
28
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Koziarski
8
- - Infogroup
9
- autorequire:
8
+ - Data Axle
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-05-20 00:00:00.000000000 Z
12
+ date: 2022-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -17,42 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '5.2'
20
+ version: '6.1'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '5.2'
27
+ version: '6.1'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: activerecord
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: '5.2'
34
+ version: '6.1'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: '5.2'
42
- - !ruby/object:Gem::Dependency
43
- name: globalid
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - ">="
47
- - !ruby/object:Gem::Version
48
- version: '0'
49
- type: :runtime
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- version: '0'
41
+ version: '6.1'
56
42
  - !ruby/object:Gem::Dependency
57
43
  name: bundler
58
44
  requirement: !ruby/object:Gem::Requirement
@@ -71,16 +57,16 @@ dependencies:
71
57
  name: rails
72
58
  requirement: !ruby/object:Gem::Requirement
73
59
  requirements:
74
- - - ">="
60
+ - - "~>"
75
61
  - !ruby/object:Gem::Version
76
- version: '0'
62
+ version: '6.1'
77
63
  type: :development
78
64
  prerelease: false
79
65
  version_requirements: !ruby/object:Gem::Requirement
80
66
  requirements:
81
- - - ">="
67
+ - - "~>"
82
68
  - !ruby/object:Gem::Version
83
- version: '0'
69
+ version: '6.1'
84
70
  description: ActiveModel-based JSONB document store
85
71
  email: developer@matthewhiggins.com
86
72
  executables: []
@@ -88,11 +74,11 @@ extensions: []
88
74
  extra_rdoc_files:
89
75
  - README.md
90
76
  files:
77
+ - ".github/workflows/ruby.yml"
91
78
  - ".gitignore"
92
- - ".travis.yml"
79
+ - ".simplecov"
93
80
  - CHANGELOG.md
94
81
  - Gemfile
95
- - Gemfile.rails6
96
82
  - LICENSE
97
83
  - MIT-LICENSE
98
84
  - README.md
@@ -122,9 +108,9 @@ files:
122
108
  - lib/superstore/persistence.rb
123
109
  - lib/superstore/railtie.rb
124
110
  - lib/superstore/relation/scrolling.rb
125
- - lib/superstore/timestamp.rb
126
111
  - lib/superstore/types.rb
127
112
  - lib/superstore/types/array_type.rb
113
+ - lib/superstore/types/base.rb
128
114
  - lib/superstore/types/boolean_type.rb
129
115
  - lib/superstore/types/date_range_type.rb
130
116
  - lib/superstore/types/date_type.rb
@@ -178,7 +164,7 @@ licenses:
178
164
  - ISC
179
165
  - MIT
180
166
  metadata: {}
181
- post_install_message:
167
+ post_install_message:
182
168
  rdoc_options: []
183
169
  require_paths:
184
170
  - lib
@@ -186,15 +172,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
186
172
  requirements:
187
173
  - - ">="
188
174
  - !ruby/object:Gem::Version
189
- version: 2.0.0
175
+ version: 3.0.0
190
176
  required_rubygems_version: !ruby/object:Gem::Requirement
191
177
  requirements:
192
178
  - - ">="
193
179
  - !ruby/object:Gem::Version
194
- version: 1.3.5
180
+ version: 3.2.0
195
181
  requirements: []
196
- rubygems_version: 3.0.3
197
- signing_key:
182
+ rubygems_version: 3.1.6
183
+ signing_key:
198
184
  specification_version: 4
199
185
  summary: ActiveModel for JSONB documents
200
186
  test_files: []
data/.travis.yml DELETED
@@ -1,11 +0,0 @@
1
- language: ruby
2
- rvm: 2.6.3
3
- dist: xenial
4
- cache: bundler
5
- gemfile:
6
- - Gemfile
7
- - Gemfile.rails6
8
- addons:
9
- postgresql: 9.6
10
- services:
11
- - postgresql
data/Gemfile.rails6 DELETED
@@ -1,10 +0,0 @@
1
- source 'https://rubygems.org'
2
- gemspec
3
-
4
- gem 'rails', '~> 6.0.0.rc1'
5
- gem 'rake'
6
-
7
- group :test do
8
- gem 'pg'
9
- gem 'mocha', require: false
10
- end
@@ -1,13 +0,0 @@
1
- module Superstore
2
- module Timestamp
3
- extend ActiveSupport::Concern
4
-
5
- class_methods do
6
- def inherited(child)
7
- super
8
- child.attribute :created_at, type: :time
9
- child.attribute :updated_at, type: :time
10
- end
11
- end
12
- end
13
- end