rails-settings-cached 2.9.1 → 2.9.3

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: 39d71006c4cd637ddb495d703487eda60b7fb1c6ef7faebcf52154f69073a59b
4
- data.tar.gz: 40520bb31ea809e805ad568a653b0c4f5cfbb80de54473c9aa8d55d8279f3b38
3
+ metadata.gz: 56978bb6963c13b5f83ae09b460fbdc6cfe5841233bbfb7e54db4a18648a56f7
4
+ data.tar.gz: 8269965e9356e03eeb50cc9f5a819b7a875cdac92911446841cea9f0776e5d24
5
5
  SHA512:
6
- metadata.gz: f95ff5d1b2833238b81c44aa326c4a137bd02e303d31df40bbcd85a8bdce178bdd2d9261d12b8ce0d67d75678c461f61de9ab79093b289194401f755aad0eef7
7
- data.tar.gz: '0689d816a85358374c654f1f996ea1b6930b47fd9099333d25484276ebb326c332d4f594574b67d822961e04d4ecd55c4da8c80bd29266b751861b7960931502'
6
+ metadata.gz: 5cce734046980fafc3a1c7678599220cb61ff7aad75115b1a61aa07517ec6d4abd7650d221deee0bfe65d465e218e82413556a6b6dab408f9e167cdb8ad037f9
7
+ data.tar.gz: 8c2af6ec2dff0e1111c2b1972959396995456296ea2a3f307852cfa1ce3fdf63036bc9aeebf1c9edfcb74ce2f0cb17bf7b34ce257c632ea297253cd32e0266bc
@@ -15,8 +15,16 @@ module RailsSettings
15
15
 
16
16
  @@migrations = false
17
17
 
18
+ def self.timestamped_migrations
19
+ if ActiveRecord::Base.respond_to?(:timestamped_migrations)
20
+ ActiveRecord::Base.timestamped_migrations
21
+ elsif ActiveRecord.respond_to?(:timestamped_migrations)
22
+ ActiveRecord.timestamped_migrations
23
+ end
24
+ end
25
+
18
26
  def self.next_migration_number(dirname) #:nodoc:
19
- if ActiveRecord::Base.timestamped_migrations
27
+ if timestamped_migrations
20
28
  if @@migrations
21
29
  (current_migration_number(dirname) + 1)
22
30
  else
@@ -2,6 +2,8 @@ module RailsSettings
2
2
  module Fields
3
3
  class Array < ::RailsSettings::Fields::Base
4
4
  def deserialize(value)
5
+ return nil if value.nil?
6
+
5
7
  return value unless value.is_a?(::String)
6
8
 
7
9
  value.split(separator).reject(&:empty?).map(&:strip)
@@ -2,6 +2,8 @@ module RailsSettings
2
2
  module Fields
3
3
  class BigDecimal < ::RailsSettings::Fields::Base
4
4
  def deserialize(value)
5
+ return nil if value.nil?
6
+
5
7
  value.to_d
6
8
  end
7
9
 
@@ -2,6 +2,8 @@ module RailsSettings
2
2
  module Fields
3
3
  class Boolean < ::RailsSettings::Fields::Base
4
4
  def deserialize(value)
5
+ return nil if value.nil?
6
+
5
7
  ["true", "1", 1, true].include?(value)
6
8
  end
7
9
 
@@ -2,6 +2,8 @@ module RailsSettings
2
2
  module Fields
3
3
  class Float < ::RailsSettings::Fields::Base
4
4
  def deserialize(value)
5
+ return nil if value.nil?
6
+
5
7
  value.to_f
6
8
  end
7
9
 
@@ -2,6 +2,8 @@ module RailsSettings
2
2
  module Fields
3
3
  class Hash < ::RailsSettings::Fields::Base
4
4
  def deserialize(value)
5
+ return nil if value.nil?
6
+
5
7
  return value unless value.is_a?(::String)
6
8
 
7
9
  load_value(value).deep_stringify_keys.with_indifferent_access
@@ -2,6 +2,8 @@ module RailsSettings
2
2
  module Fields
3
3
  class Integer < ::RailsSettings::Fields::Base
4
4
  def deserialize(value)
5
+ return nil if value.nil?
6
+
5
7
  value.to_i
6
8
  end
7
9
 
@@ -2,6 +2,8 @@ module RailsSettings
2
2
  module Fields
3
3
  class String < ::RailsSettings::Fields::Base
4
4
  def deserialize(value)
5
+ return nil if value.nil?
6
+
5
7
  value
6
8
  end
7
9
 
@@ -3,7 +3,7 @@
3
3
  module RailsSettings
4
4
  class << self
5
5
  def version
6
- "2.9.1"
6
+ "2.9.3"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-settings-cached
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.1
4
+ version: 2.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-01 00:00:00.000000000 Z
11
+ date: 2023-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  requirements: []
161
- rubygems_version: 3.3.25
161
+ rubygems_version: 3.4.19
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: The best solution for store global settings in Rails applications.