staugaard-magic_cache_keys 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION.yml +1 -1
  2. data/lib/magic_cache_keys.rb +1 -1
  3. metadata +1 -1
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :patch: 0
3
3
  :major: 0
4
- :minor: 2
4
+ :minor: 3
@@ -39,7 +39,7 @@ module ActiveRecord
39
39
  class << self
40
40
  def cache_key(options = {})
41
41
  order = options.delete(:order) || scope(:find, :order)
42
- opts = {:select => "MD5(CONCAT(GROUP_CONCAT(CONV(id,10,36)#{ ' ORDER BY ' + order unless order.blank?}), MAX(updated_at))) as cached_key"}.reverse_merge(options)
42
+ opts = {:select => "MD5(CONCAT(GROUP_CONCAT(CONV(#{table_name}.id,10,36)#{ ' ORDER BY ' + order unless order.blank?}), MAX(updated_at))) as cached_key"}.reverse_merge(options)
43
43
 
44
44
  connection.execute('SET group_concat_max_len = 1048576')
45
45
  "#{model_name.cache_key}/#{connection.select_value(construct_finder_sql(opts)) || 'empty'}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: staugaard-magic_cache_keys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mick Staugaard