kasket 4.5.0 → 4.5.1

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
  SHA1:
3
- metadata.gz: 5feb7145adfe7370616cdd136bd0dfd38289909a
4
- data.tar.gz: 87f59cd90a98235312a1f37349643d3d747fb279
3
+ metadata.gz: 6e712453519dbc2e9d65176a7b2643f5d93f5fbc
4
+ data.tar.gz: fe75bab997f46475cb7fdcf23302d02f85335e9f
5
5
  SHA512:
6
- metadata.gz: ad0905549d2e290fee2342b238c6a72555f2fdaabca06211d1c18bfc322831a0aba31abeaf78e95c4fe8ddb6fc15890203a97e91c0e6795d3385724116e5dd20
7
- data.tar.gz: fa8bffa79ebcba044822cf110eb8a3ac13189622d3dab7961c02a1c42a832a7222886fe668168289db65d98145aba7fffa4c855784b3c578d136da3ee3a4685d
6
+ metadata.gz: 5c7846aae753e06fd1a39bff78cb6bc84b6602cd8c6245dc2bff0d4b9705ded35723f005f2e27b4bf838e05afba59542d5c826793c90be5d6afd4fc702ad2532
7
+ data.tar.gz: 4ae174cf74a6176f843ff40bffcc965ccb9ea78dba55a3f6d19f2621b2d96ae218d0521391173c0b250e586c4e427c07c3e41d37e5779aed2619342a56604616
@@ -38,7 +38,7 @@ module Kasket
38
38
  key = attribute_value_pairs.map do |attribute, value|
39
39
  column = columns_hash[attribute.to_s]
40
40
  value = nil if value.blank?
41
- "#{attribute}=#{quoted_value_for_column(value, column)}"
41
+ "#{attribute}=#{kasket_quoted_value_for_column(value, column)}"
42
42
  end.join('/')
43
43
 
44
44
  if key.size > (250 - kasket_key_prefix.size) || key =~ /\s/
@@ -95,17 +95,16 @@ module Kasket
95
95
 
96
96
  private
97
97
 
98
- def quoted_value_for_column(value, column)
98
+ def kasket_quoted_value_for_column(value, column)
99
99
  if column
100
+ conn = connection
100
101
  casted_value =
101
- if connection.respond_to?(:type_cast_from_column)
102
- connection.type_cast_from_column(column, value)
103
- elsif column.respond_to?(:type_cast_for_database)
104
- column.type_cast_for_database(value) # Rails 4.2
105
- else
106
- column.type_cast(value)
102
+ case ActiveRecord::VERSION::MAJOR
103
+ when 3 then column.type_cast(value)
104
+ when 4 then column.type_cast_for_database(value)
105
+ else conn.type_cast_from_column(column, value)
107
106
  end
108
- connection.quote(casted_value).downcase
107
+ conn.quote(casted_value).downcase
109
108
  else
110
109
  value.to_s
111
110
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Kasket
3
- VERSION = '4.5.0'
3
+ VERSION = '4.5.1'
4
4
  class Version
5
5
  MAJOR = Kasket::VERSION.split('.')[0]
6
6
  MINOR = Kasket::VERSION.split('.')[1]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kasket
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.0
4
+ version: 4.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mick Staugaard