staugaard-magic_cache_keys 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION.yml +1 -1
- data/lib/magic_cache_keys.rb +1 -1
- metadata +1 -1
data/VERSION.yml
CHANGED
data/lib/magic_cache_keys.rb
CHANGED
@@ -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'}"
|