pg_cache_key 0.1.2 → 0.1.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
  SHA1:
3
- metadata.gz: 5d8ffcfe8dfd1a34a42688870727a3c96f539d34
4
- data.tar.gz: 466f5c9bfb47bc7706d6e242a9d31da5bbf5a51d
3
+ metadata.gz: 6a22d3542adbbdf55f3f09a4cb510986b50d5e87
4
+ data.tar.gz: a8bcb86f6338109deb7c09905d5241aa0f568550
5
5
  SHA512:
6
- metadata.gz: 47607c86ad4b89498896e8cd6931d05674a2c9f81636ad7e5ca81be2e23395e74513034aad226f6c60d4ce10781282269be65cc3840175916cc3ea89b0ea41dc
7
- data.tar.gz: 0bd221afa5afce628ae2be6aa636df476fe42f066684ec4ef79faf30a92b84768952d87d5a8b9d3b49e6833b17b1eb6637d4fca77a56d14c41afec10545dd261
6
+ metadata.gz: 37ad5b28ebc8351f40fe50cc8523d446897d1d179ce7533f25a3912dc37619f468b78e733200c3ed80559672d59bae58dd359ca21a732798ce5e672d9e17ca88
7
+ data.tar.gz: b4089abc9ac26384361d95224b7358d48378a136e23498427afae6a6256e383d92e8bbaf7a5fab8eecc12a5b88cafd70358ea5058995e183d8df1987ccc43c11
@@ -1,3 +1,3 @@
1
1
  module PgCacheKey
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/lib/pg_cache_key.rb CHANGED
@@ -26,10 +26,8 @@ module ActiveRecord
26
26
  # Rem 1: why use connection.execute instead of doing collection.select because of an order. if you using some order on your scope
27
27
  # then columns you using to order must appear in the GROUP BY clause or be used in an aggregate function or you will get an error
28
28
  # Rem 2: we need to add select( cache_columns ) explicitly because if relation has includes it might transform columns to aliases
29
- # joins(values[:includes]).unscope(:includes) - we need to move includes to joins to avoid all aliases and so
30
- # we can't unscope(:includes) completly because some where can depend on it
31
29
  @cache_keys[timestamp_column] ||= connection.execute( "SELECT md5(string_agg( #{cache_columns.map{|fld| "\"t\".\"#{fld}\"::text" }.join('||')}, '') ) as cache_key
32
- FROM (#{ joins(values[:includes]).unscope(:includes).select(cache_columns).try(:to_sql) }) t" )[0]['cache_key']
30
+ FROM (#{ select(cache_columns).try(:to_sql) }) t" )[0]['cache_key']
33
31
  end
34
32
  end
35
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_cache_key
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - alekseyl