activerecord-collection_cache_key 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.codeclimate.yml +15 -0
- data/.gitignore +9 -0
- data/.rubocop.yml +9 -0
- data/.travis.yml +18 -0
- data/Appraisals +23 -0
- data/CHANGELOG.md +11 -0
- data/CODE_OF_CONDUCT.md +15 -0
- data/CONTRIBUTING.md +30 -0
- data/Gemfile +2 -0
- data/LICENSE +21 -0
- data/README.md +47 -0
- data/Rakefile +15 -0
- data/activerecord-collection_cache_key.gemspec +23 -0
- data/gemfiles/activerecord30.gemfile +7 -0
- data/gemfiles/activerecord31.gemfile +7 -0
- data/gemfiles/activerecord32.gemfile +7 -0
- data/gemfiles/activerecord40.gemfile +7 -0
- data/gemfiles/activerecord41.gemfile +7 -0
- data/gemfiles/activerecord42.gemfile +7 -0
- data/lib/activerecord-collection_cache_key.rb +8 -0
- data/lib/collection_cache_key/active_record.rb +7 -0
- data/lib/collection_cache_key/cache_key.rb +58 -0
- data/lib/collection_cache_key/relation.rb +8 -0
- data/lib/collection_cache_key/version.rb +17 -0
- data/test/lib/collection_cache_key_test.rb +78 -0
- data/test/test_helper.rb +40 -0
- metadata +181 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 185f1aa953f1bb441199195b36f2c22e1471122a
|
4
|
+
data.tar.gz: 36b7816b234d9dddc9e2f605be97ace092ac1262
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 23ca1e42e9cd13102c39baddab18983276c8e92a1049de7eb808c0978ebe4b7e1d007e602feb73f206c2dd1900671f916ceab344fa7900c58ddde61b5681e14f
|
7
|
+
data.tar.gz: df4d5880037892e005c253150bf25b6cdbe5a1d69cb298636870bde27e2b21dd690d86300eb2405f54cc426c70a74d016a761fdfef08d9799923234c4d024dc7
|
data/.codeclimate.yml
ADDED
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 2.1
|
4
|
+
- 2.2.3
|
5
|
+
before_install:
|
6
|
+
- gem install bundler
|
7
|
+
- bundle --version
|
8
|
+
script:
|
9
|
+
- bundle exec rake test
|
10
|
+
gemfile:
|
11
|
+
- gemfiles/activerecord30.gemfile
|
12
|
+
- gemfiles/activerecord31.gemfile
|
13
|
+
- gemfiles/activerecord32.gemfile
|
14
|
+
- gemfiles/activerecord40.gemfile
|
15
|
+
- gemfiles/activerecord41.gemfile
|
16
|
+
- gemfiles/activerecord42.gemfile
|
17
|
+
cache:
|
18
|
+
bundler: true
|
data/Appraisals
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
appraise 'activerecord30' do
|
2
|
+
gem 'activerecord', '~> 3.0.0'
|
3
|
+
end
|
4
|
+
|
5
|
+
appraise 'activerecord31' do
|
6
|
+
gem 'activerecord', '~> 3.1.0'
|
7
|
+
end
|
8
|
+
|
9
|
+
appraise 'activerecord32' do
|
10
|
+
gem 'activerecord', '~> 3.2.0'
|
11
|
+
end
|
12
|
+
|
13
|
+
appraise 'activerecord40' do
|
14
|
+
gem 'activerecord', '~> 4.0.0'
|
15
|
+
end
|
16
|
+
|
17
|
+
appraise 'activerecord41' do
|
18
|
+
gem 'activerecord', '~> 4.1.0'
|
19
|
+
end
|
20
|
+
|
21
|
+
appraise 'activerecord42' do
|
22
|
+
gem 'activerecord', '~> 4.2.0'
|
23
|
+
end
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
## v0.1.0 - 2016-03-18
|
2
|
+
|
3
|
+
Initial Release
|
4
|
+
|
5
|
+
* This gem differs from current Rails master's implementation in two ways:
|
6
|
+
* To support Rails 3, the 'default' relation includes a `WHERE (1=1)` clause,
|
7
|
+
as a workaround for the fact that `.all` is an array in AR 3.
|
8
|
+
* When limiting/offseting results, the limited size of the relation is not
|
9
|
+
taken into account in the cache key; this will err toward expiring too much
|
10
|
+
rather than too little, and will *always* do a count query regardless of
|
11
|
+
whether the relation is loaded or not.
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
|
12
|
+
|
13
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
14
|
+
|
15
|
+
This Code of Conduct is adapted from the Contributor Covenant (http://contributor-covenant.org), version 1.1.0, available at http://contributor-covenant.org/version/1/1/0/
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
## Installing the code for development
|
4
|
+
|
5
|
+
This project uses [Appraisal](https://github.com/thoughtbot/appraisal) to test
|
6
|
+
against Rails 3.0-4.2 You can get up and running via the default rake task:
|
7
|
+
|
8
|
+
```
|
9
|
+
bundle
|
10
|
+
bundle exec rake
|
11
|
+
```
|
12
|
+
|
13
|
+
This will install all gemfiles needed and run the test suite against each.
|
14
|
+
|
15
|
+
## Submitting Issues
|
16
|
+
|
17
|
+
Feel free to open issues on this repo that:
|
18
|
+
|
19
|
+
- Clearly articulate the problem
|
20
|
+
- Describe how to reproduce it in a development environment
|
21
|
+
- Describe the expected output
|
22
|
+
- Include tangible examples
|
23
|
+
|
24
|
+
## Submitting Pull Requests
|
25
|
+
|
26
|
+
Likewise, pull requests should:
|
27
|
+
|
28
|
+
- Describe the problem and its solution
|
29
|
+
- Include passing tests on all supported versions of AR for any new or changed code
|
30
|
+
- Not introduce new lint violations
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
Copyright (c) 2016 CustomInk
|
3
|
+
Derived from original work by Alberto Fernández-Capel, https://github.com/afcapel
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
18
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
19
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
20
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
21
|
+
OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# Collection Cache Keys for ActiveRecord 3.0 - 4.2
|
2
|
+
|
3
|
+
[![Code Climate](https://codeclimate.com/repos/56f050f5493ebb008500b6a9/badges/bd915cce171c63066ca3/gpa.svg)](https://codeclimate.com/repos/56f050f5493ebb008500b6a9/feed) [![Build Status](https://travis-ci.org/customink/activerecord-collection_cache_key.svg?branch=master)](https://travis-ci.org/customink/activerecord-collection_cache_key)
|
4
|
+
|
5
|
+
This gem is a backport of Rails 5's [`Relation#cache_key` feature](https://github.com/rails/rails/pull/20884),
|
6
|
+
allowing smarter, deterministic caching of ActiveRecord relations.
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add `activerecord-collection_cache_key` to your `Gemfile`:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
gem 'activerecord-collection_cache_key'
|
14
|
+
```
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
You can now access the key for any ActiveRecord collection via its `#cache_key` method:
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
@scope = MyModel.where(active: 1).cache_key
|
22
|
+
```
|
23
|
+
|
24
|
+
And then use it in your view:
|
25
|
+
|
26
|
+
```erb
|
27
|
+
<% cache @scope do %>
|
28
|
+
<% # some code that renders your collection %>
|
29
|
+
<% end %>
|
30
|
+
```
|
31
|
+
|
32
|
+
**Notes on Rails 3.x and `.all`:**
|
33
|
+
|
34
|
+
In some versions of Rails covered by this gem, `Model.all` returns an array, and not an instance
|
35
|
+
of `ActiveRecord::Relation`. In these cases it's possible to access the default key via class method on the model:
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
MyModel.collection_cache_key
|
39
|
+
```
|
40
|
+
|
41
|
+
## Contributing
|
42
|
+
|
43
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for details
|
44
|
+
|
45
|
+
## Changelog
|
46
|
+
|
47
|
+
See [CHANGELOG.md](CHANGELOG.md) for details
|
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
require 'rake/testtask'
|
4
|
+
|
5
|
+
desc 'Test the gem.'
|
6
|
+
Rake::TestTask.new do |t|
|
7
|
+
t.libs = %w(lib test)
|
8
|
+
t.test_files = Dir.glob('test/**/*_test.rb').sort
|
9
|
+
t.verbose = true
|
10
|
+
end
|
11
|
+
|
12
|
+
task :default do
|
13
|
+
exec 'appraisal update'
|
14
|
+
exec 'appraisal rake test'
|
15
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
2
|
+
require 'collection_cache_key/version'
|
3
|
+
|
4
|
+
Gem::Specification.new do |spec|
|
5
|
+
spec.name = 'activerecord-collection_cache_key'
|
6
|
+
spec.version = CollectionCacheKey.version_string
|
7
|
+
spec.authors = ['Dan Drinkard']
|
8
|
+
spec.email = %w(dan.drinkard@customink.com)
|
9
|
+
spec.summary = 'Rails-5-style ActiveRecord::Relation cache keys for everyone.'
|
10
|
+
spec.description = 'Make ActiveRecord queries cacheable throughout your apps!'
|
11
|
+
spec.homepage = 'http://github.com/customink/activerecord-collection_cache_key'
|
12
|
+
spec.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
13
|
+
spec.files = `git ls-files`.split("\n")
|
14
|
+
spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
15
|
+
spec.require_paths = %w(lib)
|
16
|
+
spec.add_runtime_dependency 'activerecord', '>= 3.0', '< 5.0'
|
17
|
+
spec.add_development_dependency 'activesupport', '>= 3.0', '< 5.0'
|
18
|
+
spec.add_development_dependency 'appraisal'
|
19
|
+
spec.add_development_dependency 'minitest'
|
20
|
+
spec.add_development_dependency 'pry'
|
21
|
+
spec.add_development_dependency 'rake'
|
22
|
+
spec.add_development_dependency 'sqlite3'
|
23
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
require 'active_record'
|
2
|
+
require 'collection_cache_key/active_record'
|
3
|
+
require 'collection_cache_key/cache_key'
|
4
|
+
require 'collection_cache_key/relation'
|
5
|
+
require 'collection_cache_key/version'
|
6
|
+
|
7
|
+
ActiveRecord::Base.extend CollectionCacheKey::CacheKey
|
8
|
+
ActiveRecord::Relation.include CollectionCacheKey::Relation
|
@@ -0,0 +1,58 @@
|
|
1
|
+
module CollectionCacheKey
|
2
|
+
module CacheKey
|
3
|
+
def collection_cache_key(collection = as_default_relation,
|
4
|
+
timestamp_column = :updated_at) # :nodoc:
|
5
|
+
|
6
|
+
key, size, timestamp = details_for(collection, timestamp_column)
|
7
|
+
|
8
|
+
return "#{key}-#{size}" unless timestamp
|
9
|
+
"#{key}-#{size}-#{time_to_string(timestamp)}"
|
10
|
+
end
|
11
|
+
|
12
|
+
unless respond_to?(:cache_timestamp_format)
|
13
|
+
def cache_timestamp_format
|
14
|
+
:nsec
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def as_default_relation
|
21
|
+
where '1 = 1'
|
22
|
+
end
|
23
|
+
|
24
|
+
def details_for(collection, timestamp_column)
|
25
|
+
column = "#{connection.quote_table_name(collection.table_name)}.#{connection.quote_column_name(timestamp_column)}"
|
26
|
+
query = collection.dup
|
27
|
+
result = query.select("COUNT(*) AS size, MAX(#{column}) AS timestamp").first
|
28
|
+
|
29
|
+
[query_key(collection), result.size, parsed_timestamp(result.timestamp)]
|
30
|
+
end
|
31
|
+
|
32
|
+
def query_key(collection)
|
33
|
+
"#{collection.model_name.cache_key}/query-#{query_signature(collection)}"
|
34
|
+
end
|
35
|
+
|
36
|
+
def query_signature(collection)
|
37
|
+
Digest::MD5.hexdigest(collection.to_sql.gsub(/ +/, ' '))
|
38
|
+
end
|
39
|
+
|
40
|
+
def parsed_timestamp(value)
|
41
|
+
if ActiveRecord.stores_local_time?
|
42
|
+
Time.parse(value.to_s).utc
|
43
|
+
else
|
44
|
+
Time.use_zone('UTC') { Time.zone.parse(value.to_s) }
|
45
|
+
end
|
46
|
+
rescue ArgumentError
|
47
|
+
nil
|
48
|
+
end
|
49
|
+
|
50
|
+
def time_to_string(timestamp)
|
51
|
+
if cache_timestamp_format == :nsec
|
52
|
+
timestamp.strftime('%Y%m%d%H%M%S%9N')
|
53
|
+
else
|
54
|
+
timestamp.to_s(cache_timestamp_format)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module CollectionCacheKey
|
2
|
+
module VERSION
|
3
|
+
MAJOR = 0
|
4
|
+
MINOR = 1
|
5
|
+
PATCH = 0
|
6
|
+
PRE = nil
|
7
|
+
STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.version
|
11
|
+
Gem::Version.new VERSION::STRING
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.version_string
|
15
|
+
VERSION::STRING
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class CollectionCacheKeyTest < CollectionCacheKey::TestCase
|
4
|
+
subject { TestModel }
|
5
|
+
let(:cache_namespace) { subject.to_s.underscore.pluralize }
|
6
|
+
let(:original_time) { Time.parse('2010-01-01T00:00:00Z').utc }
|
7
|
+
let(:original_time_str) do
|
8
|
+
ar_nsec? ? '20100101000000000000000' : '20100101000000'
|
9
|
+
end
|
10
|
+
let(:update_time) { Time.parse('2020-01-01T00:00:00Z').utc }
|
11
|
+
let(:update_time_str) do
|
12
|
+
ar_nsec? ? '20200101000000000000000' : '20200101000000'
|
13
|
+
end
|
14
|
+
|
15
|
+
# rubocop:disable LineLength
|
16
|
+
let(:default_sql) { %(SELECT "#{subject.table_name}".* FROM "#{subject.table_name}" WHERE (1 = 1)) }
|
17
|
+
let(:filtered_sql) { %(SELECT "#{subject.table_name}".* FROM "#{subject.table_name}" WHERE "#{subject.table_name}"."notes" = 'group b') }
|
18
|
+
let(:limited_sql) { %(SELECT "#{subject.table_name}".* FROM "#{subject.table_name}" LIMIT 5) }
|
19
|
+
# rubocop:enable LineLength
|
20
|
+
|
21
|
+
before do
|
22
|
+
(1..10).each do |i|
|
23
|
+
notes = i < 6 ? 'group a' : 'group b'
|
24
|
+
subject.create!(name: "model #{i}",
|
25
|
+
notes: notes,
|
26
|
+
created_at: original_time,
|
27
|
+
updated_at: original_time)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe '#collection_cache_key' do
|
32
|
+
it 'implements a cache key on collections' do
|
33
|
+
digest = Digest::MD5.hexdigest(default_sql)
|
34
|
+
subject.collection_cache_key
|
35
|
+
.must_equal("#{cache_namespace}/query-#{digest}-10-#{original_time_str}")
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'updates the cache_key when a record changes' do
|
39
|
+
subject.first.update_attributes(updated_at: update_time)
|
40
|
+
digest = Digest::MD5.hexdigest(default_sql)
|
41
|
+
subject.collection_cache_key
|
42
|
+
.must_equal("#{cache_namespace}/query-#{digest}-10-#{update_time_str}")
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe '#cache_key' do
|
47
|
+
it 'implements a cache_key on relations' do
|
48
|
+
collection = subject.send(:as_default_relation)
|
49
|
+
digest = Digest::MD5.hexdigest(default_sql)
|
50
|
+
collection.cache_key
|
51
|
+
.must_equal("#{cache_namespace}/query-#{digest}-10-#{original_time_str}")
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'sets the cache key correctly when filtered' do
|
55
|
+
collection = subject.where(notes: 'group b')
|
56
|
+
digest = Digest::MD5.hexdigest(filtered_sql)
|
57
|
+
collection.cache_key
|
58
|
+
.must_equal("#{cache_namespace}/query-#{digest}-5-#{original_time_str}")
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'sets the cache_key correctly when limited' do
|
62
|
+
collection = subject.limit(5)
|
63
|
+
digest = Digest::MD5.hexdigest(limited_sql)
|
64
|
+
collection.cache_key
|
65
|
+
.must_equal("#{cache_namespace}/query-#{digest}-10-#{original_time_str}")
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
describe '#cache_timestamp_format' do
|
70
|
+
it 'sets the default timestamp format' do
|
71
|
+
if ar_nsec?
|
72
|
+
subject.cache_timestamp_format.must_equal(:nsec)
|
73
|
+
else
|
74
|
+
subject.cache_timestamp_format.must_equal(:number)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
Bundler.require :development, :test
|
3
|
+
|
4
|
+
require 'active_support'
|
5
|
+
require 'active_support/core_ext/string'
|
6
|
+
require 'active_support/deprecation'
|
7
|
+
require 'activerecord-collection_cache_key'
|
8
|
+
require 'minitest/autorun'
|
9
|
+
require 'logger'
|
10
|
+
|
11
|
+
ActiveRecord::Base.logger = Logger.new('/dev/null')
|
12
|
+
ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'
|
13
|
+
ActiveSupport::Deprecation.silenced = true
|
14
|
+
|
15
|
+
module CollectionCacheKey
|
16
|
+
class TestCase < MiniTest::Spec
|
17
|
+
before { setup_schema }
|
18
|
+
|
19
|
+
def ar_nsec?
|
20
|
+
!::ActiveRecord::VERSION::STRING.start_with? '3.2.'
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def setup_schema
|
26
|
+
::ActiveRecord::Base.class_eval do
|
27
|
+
connection.instance_eval do
|
28
|
+
create_table :test_models, force: true do |t|
|
29
|
+
t.text :name
|
30
|
+
t.text :notes
|
31
|
+
t.timestamps
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
class TestModel < ::ActiveRecord::Base
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
metadata
ADDED
@@ -0,0 +1,181 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: activerecord-collection_cache_key
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dan Drinkard
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-03-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activerecord
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '5.0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: activesupport
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '3.0'
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '5.0'
|
43
|
+
type: :development
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '3.0'
|
50
|
+
- - "<"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '5.0'
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: appraisal
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
type: :development
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: minitest
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
type: :development
|
75
|
+
prerelease: false
|
76
|
+
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: pry
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: rake
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
109
|
+
- !ruby/object:Gem::Dependency
|
110
|
+
name: sqlite3
|
111
|
+
requirement: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
116
|
+
type: :development
|
117
|
+
prerelease: false
|
118
|
+
version_requirements: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0'
|
123
|
+
description: Make ActiveRecord queries cacheable throughout your apps!
|
124
|
+
email:
|
125
|
+
- dan.drinkard@customink.com
|
126
|
+
executables: []
|
127
|
+
extensions: []
|
128
|
+
extra_rdoc_files: []
|
129
|
+
files:
|
130
|
+
- ".codeclimate.yml"
|
131
|
+
- ".gitignore"
|
132
|
+
- ".rubocop.yml"
|
133
|
+
- ".travis.yml"
|
134
|
+
- Appraisals
|
135
|
+
- CHANGELOG.md
|
136
|
+
- CODE_OF_CONDUCT.md
|
137
|
+
- CONTRIBUTING.md
|
138
|
+
- Gemfile
|
139
|
+
- LICENSE
|
140
|
+
- README.md
|
141
|
+
- Rakefile
|
142
|
+
- activerecord-collection_cache_key.gemspec
|
143
|
+
- gemfiles/activerecord30.gemfile
|
144
|
+
- gemfiles/activerecord31.gemfile
|
145
|
+
- gemfiles/activerecord32.gemfile
|
146
|
+
- gemfiles/activerecord40.gemfile
|
147
|
+
- gemfiles/activerecord41.gemfile
|
148
|
+
- gemfiles/activerecord42.gemfile
|
149
|
+
- lib/activerecord-collection_cache_key.rb
|
150
|
+
- lib/collection_cache_key/active_record.rb
|
151
|
+
- lib/collection_cache_key/cache_key.rb
|
152
|
+
- lib/collection_cache_key/relation.rb
|
153
|
+
- lib/collection_cache_key/version.rb
|
154
|
+
- test/lib/collection_cache_key_test.rb
|
155
|
+
- test/test_helper.rb
|
156
|
+
homepage: http://github.com/customink/activerecord-collection_cache_key
|
157
|
+
licenses: []
|
158
|
+
metadata: {}
|
159
|
+
post_install_message:
|
160
|
+
rdoc_options: []
|
161
|
+
require_paths:
|
162
|
+
- lib
|
163
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - ">="
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '0'
|
168
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '0'
|
173
|
+
requirements: []
|
174
|
+
rubyforge_project:
|
175
|
+
rubygems_version: 2.2.3
|
176
|
+
signing_key:
|
177
|
+
specification_version: 4
|
178
|
+
summary: Rails-5-style ActiveRecord::Relation cache keys for everyone.
|
179
|
+
test_files:
|
180
|
+
- test/lib/collection_cache_key_test.rb
|
181
|
+
- test/test_helper.rb
|