solidus_brazilian_adaptations 1.3.3 → 1.4.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: 7527206cec6e6e4c108caf67fc84b32db60d8d01bd6370ecb46581b2f6433490
4
- data.tar.gz: c7d5f98b8581f2169098e5c26e175cfc3cb4d897469ce8810983e563e9d1c5e0
3
+ metadata.gz: 8d7b0a16447069c50e70754bd6cd045edcbcc062f35a2d09c068b769b668585e
4
+ data.tar.gz: 1ea80df0ab3defa536732a249ba059ffe454cc9542723ea3200fbd372f75fa20
5
5
  SHA512:
6
- metadata.gz: 1da5a89034eef159f03ada7494145ce57696cd437556deb6dc141687063ffc65c52c32ccd754551185512532bc57b62f38023e6796083bf64a3b1c0dde2741b2
7
- data.tar.gz: 14c658e98a31d07f3e0eface8f34392311ff63630914eb98671dcaf052de990fbed30cc2adbbc317375e3a9972cf6ee04dc21a622a5343064ccd1086738fb5ec
6
+ metadata.gz: da111c206d4607aed9a6c54103a66cf89e58ed4dc6bc54d8b63a337e2427de750a444bd9a6ab886451619bf27bd78be4d2ee954dfa2457a85e1e6e094efa169e
7
+ data.tar.gz: 28ac58bc40a73c0b779b6dea1c60839b815e9a6ede135cad3aa659c037d69f7c5a1a355233866fa4fd0a93dac527bf14b5e175a7a968bc068243a88be50c4f6d
@@ -1,6 +1,18 @@
1
1
  class ChangeTypeMinAndMaxDeliveryTime < ActiveRecord::Migration[7.1]
2
2
  def change
3
- change_column :spree_shipping_rates, :min_delivery_time, :datetime
4
- change_column :spree_shipping_rates, :max_delivery_time, :datetime
3
+ if column_type(:spree_shipping_rates, :min_delivery_time) == :integer
4
+ change_column :spree_shipping_rates, :min_delivery_time, "timestamp USING to_timestamp(min_delivery_time)"
5
+ end
6
+
7
+ if column_type(:spree_shipping_rates, :max_delivery_time) == :integer
8
+ change_column :spree_shipping_rates, :max_delivery_time, "timestamp USING to_timestamp(max_delivery_time)"
9
+ end
10
+ end
11
+
12
+ private
13
+
14
+ # Helper para checar o tipo da coluna
15
+ def column_type(table, column)
16
+ connection.columns(table).find { |c| c.name == column.to_s }.sql_type_metadata.type
5
17
  end
6
18
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusBrazilianAdaptations
4
- VERSION = "1.3.3"
4
+ VERSION = "1.4.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_brazilian_adaptations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ulysses-bull
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-17 00:00:00.000000000 Z
11
+ date: 2024-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_core