acts_as_footprintable 0.6.1 → 0.6.3
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.
- checksums.yaml +4 -4
 - data/.github/workflows/gem-push.yml +4 -4
 - data/.github/workflows/test.yml +23 -3
 - data/.rubocop.yml +30 -0
 - data/Gemfile +5 -4
 - data/Rakefile +4 -2
 - data/acts_as_footprintable.gemspec +26 -13
 - data/config.ru +3 -3
 - data/gemfiles/rails_5.0.gemfile +3 -0
 - data/gemfiles/rails_5.1.gemfile +3 -1
 - data/gemfiles/rails_5.2.gemfile +2 -0
 - data/gemfiles/rails_6.0.gemfile +2 -0
 - data/gemfiles/rails_6.1.gemfile +2 -0
 - data/gemfiles/rails_7.0.gemfile +2 -0
 - data/gemfiles/rails_7.1.gemfile +12 -0
 - data/lib/acts_as_footprintable/extenders/footprintable.rb +5 -4
 - data/lib/acts_as_footprintable/extenders/footprinter.rb +4 -3
 - data/lib/acts_as_footprintable/footprint.rb +5 -3
 - data/lib/acts_as_footprintable/footprintable.rb +2 -1
 - data/lib/acts_as_footprintable/footprinter.rb +29 -11
 - data/lib/acts_as_footprintable/version.rb +3 -1
 - data/lib/acts_as_footprintable.rb +2 -0
 - data/lib/generators/acts_as_footprintable/migration/migration_generator.rb +13 -11
 - data/lib/generators/acts_as_footprintable/migration/templates/active_record/migration.rb +2 -0
 - data/test/footprintable_test.rb +29 -28
 - data/test/footprinter_test.rb +27 -25
 - data/test/internal/app/models/footprintable.rb +4 -3
 - data/test/internal/app/models/not_footprintable.rb +4 -3
 - data/test/internal/app/models/not_user.rb +3 -2
 - data/test/internal/app/models/second_footprintable.rb +4 -3
 - data/test/internal/app/models/user.rb +3 -2
 - data/test/test_helper.rb +27 -22
 - metadata +161 -14
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: f3a1797bbdc639f3c5aed20a3dbae6314b1d080ec9486f322d5740064f58a6f9
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 07c05e5520ffb53c5e190e2a29154695809dd10b1c6694ad642ed6fd2317cc4e
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: efc7970edafc239b27c466755e47d3cbfb554eadb2fe014a3773324bf54f9adbcdf5d3a20c24f4d0846a84a09582a19aa63b5fe35bdfa022a98c63e06909c65a
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 79b3314c609c674e645bc2a7515734da5410c966729315380f7c1a28f2ffcefb2261702ea8237891dd6a49882f9918b968ea46ae599f824819af30c251e4fc95
         
     | 
| 
         @@ -12,11 +12,11 @@ jobs: 
     | 
|
| 
       12 
12 
     | 
    
         
             
                  packages: write
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
14 
     | 
    
         
             
                steps:
         
     | 
| 
       15 
     | 
    
         
            -
                  - uses: actions/checkout@ 
     | 
| 
       16 
     | 
    
         
            -
                  - name: Set up Ruby 
     | 
| 
       17 
     | 
    
         
            -
                    uses:  
     | 
| 
      
 15 
     | 
    
         
            +
                  - uses: actions/checkout@v4
         
     | 
| 
      
 16 
     | 
    
         
            +
                  - name: Set up Ruby
         
     | 
| 
      
 17 
     | 
    
         
            +
                    uses: ruby/setup-ruby@v1
         
     | 
| 
       18 
18 
     | 
    
         
             
                    with:
         
     | 
| 
       19 
     | 
    
         
            -
                      ruby-version:  
     | 
| 
      
 19 
     | 
    
         
            +
                      ruby-version: "3.1"
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
                  - name: Publish to RubyGems
         
     | 
| 
       22 
22 
     | 
    
         
             
                    run: |
         
     | 
    
        data/.github/workflows/test.yml
    CHANGED
    
    | 
         @@ -11,11 +11,13 @@ jobs: 
     | 
|
| 
       11 
11 
     | 
    
         
             
                runs-on: ubuntu-latest
         
     | 
| 
       12 
12 
     | 
    
         
             
                strategy:
         
     | 
| 
       13 
13 
     | 
    
         
             
                  matrix:
         
     | 
| 
       14 
     | 
    
         
            -
                    ruby: ['2.6', '2.7', '3.0', '3.1']
         
     | 
| 
       15 
     | 
    
         
            -
                    gemfile: ['rails_5.0', 'rails_5.1', 'rails_5.2', 'rails_6.0', 'rails_6.1', 'rails_7.0']
         
     | 
| 
      
 14 
     | 
    
         
            +
                    ruby: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
         
     | 
| 
      
 15 
     | 
    
         
            +
                    gemfile: ['rails_5.0', 'rails_5.1', 'rails_5.2', 'rails_6.0', 'rails_6.1', 'rails_7.0', 'rails_7.1']
         
     | 
| 
       16 
16 
     | 
    
         
             
                    exclude:
         
     | 
| 
       17 
17 
     | 
    
         
             
                      - ruby: '2.6'
         
     | 
| 
       18 
18 
     | 
    
         
             
                        gemfile: 'rails_7.0'
         
     | 
| 
      
 19 
     | 
    
         
            +
                      - ruby: '2.6'
         
     | 
| 
      
 20 
     | 
    
         
            +
                        gemfile: 'rails_7.1'
         
     | 
| 
       19 
21 
     | 
    
         
             
                      - ruby: '3.0'
         
     | 
| 
       20 
22 
     | 
    
         
             
                        gemfile: 'rails_5.0'
         
     | 
| 
       21 
23 
     | 
    
         
             
                      - ruby: '3.0'
         
     | 
| 
         @@ -28,11 +30,29 @@ jobs: 
     | 
|
| 
       28 
30 
     | 
    
         
             
                        gemfile: 'rails_5.1'
         
     | 
| 
       29 
31 
     | 
    
         
             
                      - ruby: '3.1'
         
     | 
| 
       30 
32 
     | 
    
         
             
                        gemfile: 'rails_5.2'
         
     | 
| 
      
 33 
     | 
    
         
            +
                      - ruby: '3.2'
         
     | 
| 
      
 34 
     | 
    
         
            +
                        gemfile: 'rails_5.0'
         
     | 
| 
      
 35 
     | 
    
         
            +
                      - ruby: '3.2'
         
     | 
| 
      
 36 
     | 
    
         
            +
                        gemfile: 'rails_5.1'
         
     | 
| 
      
 37 
     | 
    
         
            +
                      - ruby: '3.2'
         
     | 
| 
      
 38 
     | 
    
         
            +
                        gemfile: 'rails_5.2'
         
     | 
| 
      
 39 
     | 
    
         
            +
                      - ruby: '3.3'
         
     | 
| 
      
 40 
     | 
    
         
            +
                        gemfile: 'rails_5.0'
         
     | 
| 
      
 41 
     | 
    
         
            +
                      - ruby: '3.3'
         
     | 
| 
      
 42 
     | 
    
         
            +
                        gemfile: 'rails_5.1'
         
     | 
| 
      
 43 
     | 
    
         
            +
                      - ruby: '3.3'
         
     | 
| 
      
 44 
     | 
    
         
            +
                        gemfile: 'rails_5.2'
         
     | 
| 
      
 45 
     | 
    
         
            +
                      - ruby: '3.4'
         
     | 
| 
      
 46 
     | 
    
         
            +
                        gemfile: 'rails_5.0'
         
     | 
| 
      
 47 
     | 
    
         
            +
                      - ruby: '3.4'
         
     | 
| 
      
 48 
     | 
    
         
            +
                        gemfile: 'rails_5.1'
         
     | 
| 
      
 49 
     | 
    
         
            +
                      - ruby: '3.4'
         
     | 
| 
      
 50 
     | 
    
         
            +
                        gemfile: 'rails_5.2'
         
     | 
| 
       31 
51 
     | 
    
         
             
                env:
         
     | 
| 
       32 
52 
     | 
    
         
             
                  BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
         
     | 
| 
       33 
53 
     | 
    
         | 
| 
       34 
54 
     | 
    
         
             
                steps:
         
     | 
| 
       35 
     | 
    
         
            -
                  - uses: actions/checkout@ 
     | 
| 
      
 55 
     | 
    
         
            +
                  - uses: actions/checkout@v4
         
     | 
| 
       36 
56 
     | 
    
         
             
                  - name: Set up Ruby
         
     | 
| 
       37 
57 
     | 
    
         
             
                    uses: ruby/setup-ruby@v1
         
     | 
| 
       38 
58 
     | 
    
         
             
                    with:
         
     | 
    
        data/.rubocop.yml
    ADDED
    
    | 
         @@ -0,0 +1,30 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require:
         
     | 
| 
      
 2 
     | 
    
         
            +
              - rubocop-performance
         
     | 
| 
      
 3 
     | 
    
         
            +
              - rubocop-rake
         
     | 
| 
      
 4 
     | 
    
         
            +
              - rubocop-minitest
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            AllCops:
         
     | 
| 
      
 7 
     | 
    
         
            +
              NewCops: enable
         
     | 
| 
      
 8 
     | 
    
         
            +
              TargetRubyVersion: 2.6
         
     | 
| 
      
 9 
     | 
    
         
            +
              Exclude:
         
     | 
| 
      
 10 
     | 
    
         
            +
                - 'lib/generators/acts_as_footprintable/migration/templates/active_record/migration.rb'
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            Layout/LineLength:
         
     | 
| 
      
 13 
     | 
    
         
            +
              AllowHeredoc: true
         
     | 
| 
      
 14 
     | 
    
         
            +
              AllowURI: true
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            Metrics/MethodLength:
         
     | 
| 
      
 17 
     | 
    
         
            +
              IgnoredMethods:
         
     | 
| 
      
 18 
     | 
    
         
            +
                - acts_as_footprintable
         
     | 
| 
      
 19 
     | 
    
         
            +
                - recent_footprint_ids
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            Metrics/BlockLength:
         
     | 
| 
      
 22 
     | 
    
         
            +
              IgnoredMethods:
         
     | 
| 
      
 23 
     | 
    
         
            +
                - describe
         
     | 
| 
      
 24 
     | 
    
         
            +
                - refine
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
            Layout/DotPosition:
         
     | 
| 
      
 27 
     | 
    
         
            +
              EnforcedStyle: trailing
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
            Style/Documentation:
         
     | 
| 
      
 30 
     | 
    
         
            +
              Enabled: false
         
     | 
    
        data/Gemfile
    CHANGED
    
    | 
         @@ -1,9 +1,10 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            #  
     | 
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       2 
3 
     | 
    
         
             
            source 'https://rubygems.org'
         
     | 
| 
       3 
     | 
    
         
            -
            git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
         
     | 
| 
      
 4 
     | 
    
         
            +
            git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
         
     | 
| 
       4 
5 
     | 
    
         | 
| 
       5 
6 
     | 
    
         
             
            # Specify your gem's dependencies in acts_as_footprintable.gemspec
         
     | 
| 
       6 
7 
     | 
    
         
             
            gemspec
         
     | 
| 
       7 
8 
     | 
    
         | 
| 
       8 
     | 
    
         
            -
            gem ' 
     | 
| 
       9 
     | 
    
         
            -
            gem 'sqlite3'
         
     | 
| 
      
 9 
     | 
    
         
            +
            gem 'activerecord'
         
     | 
| 
      
 10 
     | 
    
         
            +
            gem 'sqlite3'
         
     | 
    
        data/Rakefile
    CHANGED
    
    
| 
         @@ -1,24 +1,37 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            #  
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require 'English'
         
     | 
| 
      
 4 
     | 
    
         
            +
            lib = File.expand_path('lib', __dir__)
         
     | 
| 
       3 
5 
     | 
    
         
             
            $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
         
     | 
| 
       4 
6 
     | 
    
         
             
            require 'acts_as_footprintable/version'
         
     | 
| 
       5 
7 
     | 
    
         | 
| 
       6 
8 
     | 
    
         
             
            Gem::Specification.new do |spec|
         
     | 
| 
       7 
     | 
    
         
            -
              spec.name          =  
     | 
| 
      
 9 
     | 
    
         
            +
              spec.name          = 'acts_as_footprintable'
         
     | 
| 
       8 
10 
     | 
    
         
             
              spec.version       = ActsAsFootprintable::VERSION
         
     | 
| 
       9 
     | 
    
         
            -
              spec.author        =  
     | 
| 
       10 
     | 
    
         
            -
              spec.email         =  
     | 
| 
       11 
     | 
    
         
            -
              spec.description   =  
     | 
| 
       12 
     | 
    
         
            -
              spec.summary       =  
     | 
| 
       13 
     | 
    
         
            -
              spec.homepage      =  
     | 
| 
       14 
     | 
    
         
            -
              spec.license       =  
     | 
| 
      
 11 
     | 
    
         
            +
              spec.author        = 'Toyoaki Oko'
         
     | 
| 
      
 12 
     | 
    
         
            +
              spec.email         = 'chariderpato@gmail.com'
         
     | 
| 
      
 13 
     | 
    
         
            +
              spec.description   = 'Rails gem to allowing records to leave footprints'
         
     | 
| 
      
 14 
     | 
    
         
            +
              spec.summary       = 'Rails gem to allowing records to leave footprints'
         
     | 
| 
      
 15 
     | 
    
         
            +
              spec.homepage      = 'https://github.com/patorash/acts_as_footprintable'
         
     | 
| 
      
 16 
     | 
    
         
            +
              spec.license       = 'MIT'
         
     | 
| 
      
 17 
     | 
    
         
            +
              spec.metadata['rubygems_mfa_required'] = 'true'
         
     | 
| 
       15 
18 
     | 
    
         | 
| 
       16 
     | 
    
         
            -
              spec.files         = `git ls-files`.split( 
     | 
| 
      
 19 
     | 
    
         
            +
              spec.files         = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
         
     | 
| 
       17 
20 
     | 
    
         
             
              spec.executables   = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
         
     | 
| 
       18 
21 
     | 
    
         
             
              spec.test_files    = spec.files.grep(%r{^(test|spec|features)/})
         
     | 
| 
       19 
     | 
    
         
            -
              spec.require_paths = [ 
     | 
| 
      
 22 
     | 
    
         
            +
              spec.require_paths = ['lib']
         
     | 
| 
      
 23 
     | 
    
         
            +
              spec.required_ruby_version = '>= 2.6'
         
     | 
| 
       20 
24 
     | 
    
         | 
| 
      
 25 
     | 
    
         
            +
              spec.add_dependency 'activerecord', '< 7.2.0', '>= 5.0.0'
         
     | 
| 
      
 26 
     | 
    
         
            +
              spec.add_development_dependency 'concurrent-ruby', '1.3.4'
         
     | 
| 
      
 27 
     | 
    
         
            +
              spec.add_development_dependency 'database_cleaner', '< 3.0', '>= 1.99.0'
         
     | 
| 
       21 
28 
     | 
    
         
             
              spec.add_development_dependency 'rake', '~> 13.0'
         
     | 
| 
       22 
     | 
    
         
            -
              spec.add_development_dependency ' 
     | 
| 
       23 
     | 
    
         
            -
              spec.add_development_dependency ' 
     | 
| 
      
 29 
     | 
    
         
            +
              spec.add_development_dependency 'rubocop', '~> 1.24'
         
     | 
| 
      
 30 
     | 
    
         
            +
              spec.add_development_dependency 'rubocop-minitest', '~> 0.17'
         
     | 
| 
      
 31 
     | 
    
         
            +
              spec.add_development_dependency 'rubocop-performance', '~> 1.13'
         
     | 
| 
      
 32 
     | 
    
         
            +
              spec.add_development_dependency 'rubocop-rake', '~> 0.6'
         
     | 
| 
      
 33 
     | 
    
         
            +
              spec.add_development_dependency 'sqlite3', '< 3.0', '>= 1.3'
         
     | 
| 
      
 34 
     | 
    
         
            +
              spec.add_development_dependency 'mutex_m', '~> 0.1'
         
     | 
| 
      
 35 
     | 
    
         
            +
              spec.add_development_dependency 'bigdecimal', '~> 3.0'
         
     | 
| 
      
 36 
     | 
    
         
            +
              spec.add_development_dependency 'base64', '~> 0.1'
         
     | 
| 
       24 
37 
     | 
    
         
             
            end
         
     | 
    
        data/config.ru
    CHANGED
    
    
    
        data/gemfiles/rails_5.0.gemfile
    CHANGED
    
    
    
        data/gemfiles/rails_5.1.gemfile
    CHANGED
    
    
    
        data/gemfiles/rails_5.2.gemfile
    CHANGED
    
    
    
        data/gemfiles/rails_6.0.gemfile
    CHANGED
    
    
    
        data/gemfiles/rails_6.1.gemfile
    CHANGED
    
    
    
        data/gemfiles/rails_7.0.gemfile
    CHANGED
    
    
| 
         @@ -1,4 +1,5 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            #  
     | 
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       2 
3 
     | 
    
         
             
            module ActsAsFootprintable
         
     | 
| 
       3 
4 
     | 
    
         
             
              module Extenders
         
     | 
| 
       4 
5 
     | 
    
         
             
                module Footprintable
         
     | 
| 
         @@ -15,9 +16,9 @@ module ActsAsFootprintable 
     | 
|
| 
       15 
16 
     | 
    
         
             
                        true
         
     | 
| 
       16 
17 
     | 
    
         
             
                      end
         
     | 
| 
       17 
18 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
                      def self.access_ranking(range=nil, limit=nil)
         
     | 
| 
      
 19 
     | 
    
         
            +
                      def self.access_ranking(range = nil, limit = nil)
         
     | 
| 
       19 
20 
     | 
    
         
             
                        records = Footprint.for_type(self)
         
     | 
| 
       20 
     | 
    
         
            -
                        records = records.where(: 
     | 
| 
      
 21 
     | 
    
         
            +
                        records = records.where(created_at: range) unless range.nil?
         
     | 
| 
       21 
22 
     | 
    
         
             
                        records = records.limit(limit) unless limit.nil?
         
     | 
| 
       22 
23 
     | 
    
         
             
                        records.group(:footprintable_id).order('count_footprintable_id desc').count(:footprintable_id)
         
     | 
| 
       23 
24 
     | 
    
         
             
                      end
         
     | 
| 
         @@ -25,4 +26,4 @@ module ActsAsFootprintable 
     | 
|
| 
       25 
26 
     | 
    
         
             
                  end
         
     | 
| 
       26 
27 
     | 
    
         
             
                end
         
     | 
| 
       27 
28 
     | 
    
         
             
              end
         
     | 
| 
       28 
     | 
    
         
            -
            end
         
     | 
| 
      
 29 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -1,4 +1,5 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            #  
     | 
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       2 
3 
     | 
    
         
             
            module ActsAsFootprintable
         
     | 
| 
       3 
4 
     | 
    
         
             
              module Extenders
         
     | 
| 
       4 
5 
     | 
    
         
             
                module Footprinter
         
     | 
| 
         @@ -6,7 +7,7 @@ module ActsAsFootprintable 
     | 
|
| 
       6 
7 
     | 
    
         
             
                    false
         
     | 
| 
       7 
8 
     | 
    
         
             
                  end
         
     | 
| 
       8 
9 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
                  def acts_as_footprinter(* 
     | 
| 
      
 10 
     | 
    
         
            +
                  def acts_as_footprinter(*_args)
         
     | 
| 
       10 
11 
     | 
    
         
             
                    require 'acts_as_footprintable/footprinter'
         
     | 
| 
       11 
12 
     | 
    
         
             
                    include ActsAsFootprintable::Footprinter
         
     | 
| 
       12 
13 
     | 
    
         | 
| 
         @@ -18,4 +19,4 @@ module ActsAsFootprintable 
     | 
|
| 
       18 
19 
     | 
    
         
             
                  end
         
     | 
| 
       19 
20 
     | 
    
         
             
                end
         
     | 
| 
       20 
21 
     | 
    
         
             
              end
         
     | 
| 
       21 
     | 
    
         
            -
            end
         
     | 
| 
      
 22 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -1,12 +1,14 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       1 
3 
     | 
    
         
             
            module ActsAsFootprintable
         
     | 
| 
       2 
4 
     | 
    
         
             
              class Footprint < ::ActiveRecord::Base
         
     | 
| 
       3 
5 
     | 
    
         
             
                belongs_to :footprintable, polymorphic: true
         
     | 
| 
       4 
6 
     | 
    
         
             
                belongs_to :footprinter, polymorphic: true
         
     | 
| 
       5 
7 
     | 
    
         | 
| 
       6 
     | 
    
         
            -
                scope :for_type,  
     | 
| 
       7 
     | 
    
         
            -
                scope :by_type,   
     | 
| 
      
 8 
     | 
    
         
            +
                scope :for_type, ->(klass) { where(footprintable_type: klass.name) }
         
     | 
| 
      
 9 
     | 
    
         
            +
                scope :by_type,  ->(klass) { where(footprinter_type: klass.name) }
         
     | 
| 
       8 
10 
     | 
    
         | 
| 
       9 
11 
     | 
    
         
             
                validates :footprintable_id, presence: true
         
     | 
| 
       10 
12 
     | 
    
         
             
                validates :footprinter_id, presence: true
         
     | 
| 
       11 
13 
     | 
    
         
             
              end
         
     | 
| 
       12 
     | 
    
         
            -
            end
         
     | 
| 
      
 14 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -1,3 +1,5 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       1 
3 
     | 
    
         
             
            module ActsAsFootprintable
         
     | 
| 
       2 
4 
     | 
    
         
             
              module Footprinter
         
     | 
| 
       3 
5 
     | 
    
         
             
                def self.included(base)
         
     | 
| 
         @@ -15,30 +17,46 @@ module ActsAsFootprintable 
     | 
|
| 
       15 
17 
     | 
    
         
             
                  footprint.save
         
     | 
| 
       16 
18 
     | 
    
         
             
                end
         
     | 
| 
       17 
19 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
                def access_histories_for(klass, limit=nil)
         
     | 
| 
      
 20 
     | 
    
         
            +
                def access_histories_for(klass, limit = nil)
         
     | 
| 
       19 
21 
     | 
    
         
             
                  get_access_history_records(footprints.for_type(klass), limit)
         
     | 
| 
       20 
22 
     | 
    
         
             
                end
         
     | 
| 
       21 
23 
     | 
    
         | 
| 
       22 
     | 
    
         
            -
                def access_histories(limit=nil)
         
     | 
| 
      
 24 
     | 
    
         
            +
                def access_histories(limit = nil)
         
     | 
| 
       23 
25 
     | 
    
         
             
                  get_access_history_records(footprints, limit)
         
     | 
| 
       24 
26 
     | 
    
         
             
                end
         
     | 
| 
       25 
27 
     | 
    
         | 
| 
       26 
28 
     | 
    
         
             
                private
         
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                def get_access_history_records(target, limit = nil)
         
     | 
| 
      
 31 
     | 
    
         
            +
                  footprints.where(id: recent_footprint_ids(target, limit)).order('created_at DESC')
         
     | 
| 
       29 
32 
     | 
    
         
             
                end
         
     | 
| 
       30 
33 
     | 
    
         | 
| 
       31 
34 
     | 
    
         
             
                def table_name
         
     | 
| 
       32 
35 
     | 
    
         
             
                  ActsAsFootprintable::Footprint.table_name
         
     | 
| 
       33 
36 
     | 
    
         
             
                end
         
     | 
| 
       34 
37 
     | 
    
         | 
| 
       35 
     | 
    
         
            -
                def recent_footprint_ids(target, limit=nil)
         
     | 
| 
       36 
     | 
    
         
            -
                   
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
      
 38 
     | 
    
         
            +
                def recent_footprint_ids(target, limit = nil)
         
     | 
| 
      
 39 
     | 
    
         
            +
                  records = footprints.where(<<~SQL)
         
     | 
| 
      
 40 
     | 
    
         
            +
                    (
         
     | 
| 
      
 41 
     | 
    
         
            +
                      #{table_name}.footprintable_id,
         
     | 
| 
      
 42 
     | 
    
         
            +
                      #{table_name}.footprintable_type,
         
     | 
| 
      
 43 
     | 
    
         
            +
                      #{table_name}.created_at
         
     | 
| 
      
 44 
     | 
    
         
            +
                    ) IN (#{recent_footprints_by(target).to_sql})
         
     | 
| 
      
 45 
     | 
    
         
            +
                  SQL
         
     | 
| 
      
 46 
     | 
    
         
            +
                  records = records.order('footprints.created_at desc')
         
     | 
| 
       40 
47 
     | 
    
         
             
                  records = records.limit(limit) unless limit.nil?
         
     | 
| 
       41 
     | 
    
         
            -
                  records. 
     | 
| 
      
 48 
     | 
    
         
            +
                  records.ids
         
     | 
| 
      
 49 
     | 
    
         
            +
                end
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
                def recent_footprints_by(target)
         
     | 
| 
      
 52 
     | 
    
         
            +
                  target.group(
         
     | 
| 
      
 53 
     | 
    
         
            +
                    "#{table_name}.footprintable_id",
         
     | 
| 
      
 54 
     | 
    
         
            +
                    "#{table_name}.footprintable_type"
         
     | 
| 
      
 55 
     | 
    
         
            +
                  ).select(
         
     | 
| 
      
 56 
     | 
    
         
            +
                    "#{table_name}.footprintable_id",
         
     | 
| 
      
 57 
     | 
    
         
            +
                    "#{table_name}.footprintable_type",
         
     | 
| 
      
 58 
     | 
    
         
            +
                    "MAX(#{table_name}.created_at) AS created_at"
         
     | 
| 
      
 59 
     | 
    
         
            +
                  )
         
     | 
| 
       42 
60 
     | 
    
         
             
                end
         
     | 
| 
       43 
61 
     | 
    
         
             
              end
         
     | 
| 
       44 
     | 
    
         
            -
            end
         
     | 
| 
      
 62 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -1,41 +1,43 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       1 
3 
     | 
    
         
             
            require 'rails/generators/migration'
         
     | 
| 
       2 
4 
     | 
    
         | 
| 
       3 
5 
     | 
    
         
             
            module ActsAsFootprintable
         
     | 
| 
       4 
6 
     | 
    
         
             
              class MigrationGenerator < Rails::Generators::Base
         
     | 
| 
       5 
7 
     | 
    
         
             
                include Rails::Generators::Migration
         
     | 
| 
       6 
8 
     | 
    
         | 
| 
       7 
     | 
    
         
            -
                desc  
     | 
| 
      
 9 
     | 
    
         
            +
                desc 'Generators migration for footprintable(footprints table)'
         
     | 
| 
       8 
10 
     | 
    
         | 
| 
       9 
11 
     | 
    
         
             
                def self.orm
         
     | 
| 
       10 
12 
     | 
    
         
             
                  Rails::Generators.options[:rails][:orm]
         
     | 
| 
       11 
13 
     | 
    
         
             
                end
         
     | 
| 
       12 
14 
     | 
    
         | 
| 
       13 
15 
     | 
    
         
             
                def self.source_root
         
     | 
| 
       14 
     | 
    
         
            -
                  File.join(File.dirname(__FILE__), 'templates', (orm.to_s unless orm. 
     | 
| 
      
 16 
     | 
    
         
            +
                  File.join(File.dirname(__FILE__), 'templates', (orm.to_s unless orm.instance_of?(String)))
         
     | 
| 
       15 
17 
     | 
    
         
             
                end
         
     | 
| 
       16 
18 
     | 
    
         | 
| 
       17 
19 
     | 
    
         
             
                def self.orm_has_migration?
         
     | 
| 
       18 
20 
     | 
    
         
             
                  [:active_record].include? orm
         
     | 
| 
       19 
21 
     | 
    
         
             
                end
         
     | 
| 
       20 
22 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
                def self.next_migration_number( 
     | 
| 
       22 
     | 
    
         
            -
                  Time.now.utc.strftime( 
     | 
| 
      
 23 
     | 
    
         
            +
                def self.next_migration_number(_path)
         
     | 
| 
      
 24 
     | 
    
         
            +
                  Time.now.utc.strftime('%Y%m%d%H%M%S')
         
     | 
| 
       23 
25 
     | 
    
         
             
                end
         
     | 
| 
       24 
26 
     | 
    
         | 
| 
       25 
27 
     | 
    
         
             
                def create_migration_file
         
     | 
| 
       26 
     | 
    
         
            -
                   
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
     | 
    
         
            -
                   
     | 
| 
      
 28 
     | 
    
         
            +
                  return unless self.class.orm_has_migration?
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                  migration_template 'migration.rb',
         
     | 
| 
      
 31 
     | 
    
         
            +
                                     'db/migrate/acts_as_footprintable_migration.rb',
         
     | 
| 
      
 32 
     | 
    
         
            +
                                     migration_version: migration_version
         
     | 
| 
       29 
33 
     | 
    
         
             
                end
         
     | 
| 
       30 
34 
     | 
    
         | 
| 
       31 
35 
     | 
    
         
             
                def migration_version
         
     | 
| 
       32 
     | 
    
         
            -
                  if over_rails5?
         
     | 
| 
       33 
     | 
    
         
            -
                    "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
         
     | 
| 
       34 
     | 
    
         
            -
                  end
         
     | 
| 
      
 36 
     | 
    
         
            +
                  "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]" if over_rails5?
         
     | 
| 
       35 
37 
     | 
    
         
             
                end
         
     | 
| 
       36 
38 
     | 
    
         | 
| 
       37 
39 
     | 
    
         
             
                def over_rails5?
         
     | 
| 
       38 
40 
     | 
    
         
             
                  Rails::VERSION::MAJOR >= 5
         
     | 
| 
       39 
41 
     | 
    
         
             
                end
         
     | 
| 
       40 
42 
     | 
    
         
             
              end
         
     | 
| 
       41 
     | 
    
         
            -
            end
         
     | 
| 
      
 43 
     | 
    
         
            +
            end
         
     | 
    
        data/test/footprintable_test.rb
    CHANGED
    
    | 
         @@ -1,65 +1,66 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       1 
3 
     | 
    
         
             
            require 'test_helper'
         
     | 
| 
       2 
4 
     | 
    
         
             
            require 'acts_as_footprintable/footprintable'
         
     | 
| 
       3 
5 
     | 
    
         | 
| 
       4 
6 
     | 
    
         
             
            describe ActsAsFootprintable::Footprintable do
         
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
              it "should not be a footprintable" do
         
     | 
| 
      
 7 
     | 
    
         
            +
              it 'should not be a footprintable' do
         
     | 
| 
       7 
8 
     | 
    
         
             
                expect(NotFootprintable).wont_be :footprintable?
         
     | 
| 
       8 
9 
     | 
    
         
             
              end
         
     | 
| 
       9 
10 
     | 
    
         | 
| 
       10 
     | 
    
         
            -
              it  
     | 
| 
      
 11 
     | 
    
         
            +
              it 'should be a footprintable' do
         
     | 
| 
       11 
12 
     | 
    
         
             
                expect(Footprintable).must_be :footprintable?
         
     | 
| 
       12 
13 
     | 
    
         
             
              end
         
     | 
| 
       13 
14 
     | 
    
         | 
| 
       14 
15 
     | 
    
         
             
              describe 'leave footprints by footprinter' do
         
     | 
| 
       15 
     | 
    
         
            -
                let(:user) { User.create!(: 
     | 
| 
       16 
     | 
    
         
            -
                let(:user2) { User.create!(: 
     | 
| 
       17 
     | 
    
         
            -
                let(:footprintable) { Footprintable.create!(: 
     | 
| 
       18 
     | 
    
         
            -
                let(:footprintable2) { Footprintable.create!(: 
     | 
| 
      
 16 
     | 
    
         
            +
                let(:user) { User.create!(name: 'i can footprint!') }
         
     | 
| 
      
 17 
     | 
    
         
            +
                let(:user2) { User.create!(name: 'a new person') }
         
     | 
| 
      
 18 
     | 
    
         
            +
                let(:footprintable) { Footprintable.create!(name: 'a footprinting model') }
         
     | 
| 
      
 19 
     | 
    
         
            +
                let(:footprintable2) { Footprintable.create!(name: 'a 2nd footprinting model') }
         
     | 
| 
       19 
20 
     | 
    
         | 
| 
       20 
     | 
    
         
            -
                it  
     | 
| 
      
 21 
     | 
    
         
            +
                it 'should be leave footprints' do
         
     | 
| 
       21 
22 
     | 
    
         
             
                  expect(footprintable.leave_footprints(user)).must_equal true
         
     | 
| 
       22 
23 
     | 
    
         
             
                end
         
     | 
| 
       23 
24 
     | 
    
         | 
| 
       24 
     | 
    
         
            -
                it  
     | 
| 
      
 25 
     | 
    
         
            +
                it '足跡の数が増えていること' do
         
     | 
| 
       25 
26 
     | 
    
         
             
                  expect(footprintable.footprint_count).must_equal 0
         
     | 
| 
       26 
27 
     | 
    
         
             
                  footprintable.leave_footprints user
         
     | 
| 
       27 
28 
     | 
    
         
             
                  expect(footprintable.footprint_count).must_equal 1
         
     | 
| 
       28 
29 
     | 
    
         
             
                end
         
     | 
| 
       29 
30 
     | 
    
         | 
| 
       30 
     | 
    
         
            -
                it  
     | 
| 
      
 31 
     | 
    
         
            +
                it '10回アクセスしたら10になること' do
         
     | 
| 
       31 
32 
     | 
    
         
             
                  expect(footprintable.footprint_count).must_equal 0
         
     | 
| 
       32 
33 
     | 
    
         
             
                  10.times { footprintable.leave_footprints user }
         
     | 
| 
       33 
34 
     | 
    
         
             
                  expect(footprintable.footprint_count).must_equal 10
         
     | 
| 
       34 
35 
     | 
    
         
             
                end
         
     | 
| 
       35 
36 
     | 
    
         | 
| 
       36 
     | 
    
         
            -
                it  
     | 
| 
      
 37 
     | 
    
         
            +
                it '複数人でアクセスしたら合計されること' do
         
     | 
| 
       37 
38 
     | 
    
         
             
                  expect(footprintable.footprint_count).must_equal 0
         
     | 
| 
       38 
39 
     | 
    
         
             
                  5.times { footprintable.leave_footprints user }
         
     | 
| 
       39 
40 
     | 
    
         
             
                  5.times { footprintable.leave_footprints user2 }
         
     | 
| 
       40 
41 
     | 
    
         
             
                  expect(footprintable.footprint_count).must_equal 10
         
     | 
| 
       41 
42 
     | 
    
         
             
                end
         
     | 
| 
       42 
43 
     | 
    
         | 
| 
       43 
     | 
    
         
            -
                describe  
     | 
| 
      
 44 
     | 
    
         
            +
                describe '期間指定をする' do
         
     | 
| 
       44 
45 
     | 
    
         
             
                  before do
         
     | 
| 
       45 
     | 
    
         
            -
                    ( 
     | 
| 
       46 
     | 
    
         
            -
                       
     | 
| 
      
 46 
     | 
    
         
            +
                    1.upto(30) do |day|
         
     | 
| 
      
 47 
     | 
    
         
            +
                      travel_to Time.parse("2013-09-#{day}") do
         
     | 
| 
       47 
48 
     | 
    
         
             
                        5.times { footprintable.leave_footprints user }
         
     | 
| 
       48 
49 
     | 
    
         
             
                      end
         
     | 
| 
       49 
50 
     | 
    
         
             
                    end
         
     | 
| 
       50 
51 
     | 
    
         
             
                  end
         
     | 
| 
       51 
52 
     | 
    
         | 
| 
       52 
     | 
    
         
            -
                  describe  
     | 
| 
       53 
     | 
    
         
            -
                    it  
     | 
| 
       54 
     | 
    
         
            -
                       
     | 
| 
      
 53 
     | 
    
         
            +
                  describe '1週間の場合' do
         
     | 
| 
      
 54 
     | 
    
         
            +
                    it '35の足跡があること' do
         
     | 
| 
      
 55 
     | 
    
         
            +
                      travel_to Time.parse('2013-09-30 10:00:00') do
         
     | 
| 
       55 
56 
     | 
    
         
             
                        expect(footprintable.footprint_count_between(1.week.ago..Time.now)).must_equal 35
         
     | 
| 
       56 
57 
     | 
    
         
             
                      end
         
     | 
| 
       57 
58 
     | 
    
         
             
                    end
         
     | 
| 
       58 
59 
     | 
    
         
             
                  end
         
     | 
| 
       59 
60 
     | 
    
         | 
| 
       60 
     | 
    
         
            -
                  describe  
     | 
| 
       61 
     | 
    
         
            -
                    it  
     | 
| 
       62 
     | 
    
         
            -
                       
     | 
| 
      
 61 
     | 
    
         
            +
                  describe '1ヶ月の場合' do
         
     | 
| 
      
 62 
     | 
    
         
            +
                    it '150の足跡があること' do
         
     | 
| 
      
 63 
     | 
    
         
            +
                      travel_to Time.parse('2013-09-30 10:00:00') do
         
     | 
| 
       63 
64 
     | 
    
         
             
                        expect(footprintable.footprint_count_between(1.month.ago..Time.now)).must_equal 150
         
     | 
| 
       64 
65 
     | 
    
         
             
                      end
         
     | 
| 
       65 
66 
     | 
    
         
             
                    end
         
     | 
| 
         @@ -67,14 +68,14 @@ describe ActsAsFootprintable::Footprintable do 
     | 
|
| 
       67 
68 
     | 
    
         
             
                end
         
     | 
| 
       68 
69 
     | 
    
         
             
              end
         
     | 
| 
       69 
70 
     | 
    
         | 
| 
       70 
     | 
    
         
            -
              describe  
     | 
| 
       71 
     | 
    
         
            -
                let(:user) { User.create!(: 
     | 
| 
      
 71 
     | 
    
         
            +
              describe 'アクセスランキングを作成' do
         
     | 
| 
      
 72 
     | 
    
         
            +
                let(:user) { User.create!(name: 'i can footprint!') }
         
     | 
| 
       72 
73 
     | 
    
         | 
| 
       73 
     | 
    
         
            -
                describe  
     | 
| 
      
 74 
     | 
    
         
            +
                describe '件数と期間を制限' do
         
     | 
| 
       74 
75 
     | 
    
         
             
                  before do
         
     | 
| 
       75 
     | 
    
         
            -
                    ( 
     | 
| 
       76 
     | 
    
         
            -
                       
     | 
| 
       77 
     | 
    
         
            -
                        footprintable = Footprintable.create!(: 
     | 
| 
      
 76 
     | 
    
         
            +
                    1.upto(30) do |index|
         
     | 
| 
      
 77 
     | 
    
         
            +
                      travel_to Time.parse("2013-09-#{index}") do
         
     | 
| 
      
 78 
     | 
    
         
            +
                        footprintable = Footprintable.create!(name: "Footprintable#{index}")
         
     | 
| 
       78 
79 
     | 
    
         
             
                        index.times { footprintable.leave_footprints user }
         
     | 
| 
       79 
80 
     | 
    
         
             
                      end
         
     | 
| 
       80 
81 
     | 
    
         
             
                    end
         
     | 
| 
         @@ -85,7 +86,7 @@ describe ActsAsFootprintable::Footprintable do 
     | 
|
| 
       85 
86 
     | 
    
         
             
                  end
         
     | 
| 
       86 
87 
     | 
    
         | 
| 
       87 
88 
     | 
    
         
             
                  it 'アクセスランキングが取得できること' do
         
     | 
| 
       88 
     | 
    
         
            -
                    expect(subject).must_equal 
     | 
| 
      
 89 
     | 
    
         
            +
                    expect(subject).must_equal({ 7 => 7, 6 => 6, 5 => 5, 4 => 4, 3 => 3 })
         
     | 
| 
       89 
90 
     | 
    
         
             
                  end
         
     | 
| 
       90 
91 
     | 
    
         | 
| 
       91 
92 
     | 
    
         
             
                  it '5件取得できること' do
         
     | 
| 
         @@ -93,4 +94,4 @@ describe ActsAsFootprintable::Footprintable do 
     | 
|
| 
       93 
94 
     | 
    
         
             
                  end
         
     | 
| 
       94 
95 
     | 
    
         
             
                end
         
     | 
| 
       95 
96 
     | 
    
         
             
              end
         
     | 
| 
       96 
     | 
    
         
            -
            end
         
     | 
| 
      
 97 
     | 
    
         
            +
            end
         
     | 
    
        data/test/footprinter_test.rb
    CHANGED
    
    | 
         @@ -1,61 +1,63 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       1 
3 
     | 
    
         
             
            require 'test_helper'
         
     | 
| 
       2 
4 
     | 
    
         
             
            require 'acts_as_footprintable/footprinter'
         
     | 
| 
       3 
5 
     | 
    
         | 
| 
       4 
6 
     | 
    
         
             
            describe ActsAsFootprintable::Footprinter do
         
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
              it "should not be a footprinter" do
         
     | 
| 
      
 7 
     | 
    
         
            +
              it 'should not be a footprinter' do
         
     | 
| 
       7 
8 
     | 
    
         
             
                expect(NotUser).wont_be :footprinter?
         
     | 
| 
       8 
9 
     | 
    
         
             
              end
         
     | 
| 
       9 
10 
     | 
    
         | 
| 
       10 
     | 
    
         
            -
              it  
     | 
| 
      
 11 
     | 
    
         
            +
              it 'should be a footprinter' do
         
     | 
| 
       11 
12 
     | 
    
         
             
                expect(User).must_be :footprinter?
         
     | 
| 
       12 
13 
     | 
    
         
             
              end
         
     | 
| 
       13 
14 
     | 
    
         | 
| 
       14 
     | 
    
         
            -
              describe  
     | 
| 
       15 
     | 
    
         
            -
                let(: 
     | 
| 
      
 15 
     | 
    
         
            +
              describe 'ユーザーのアクセス履歴を' do
         
     | 
| 
      
 16 
     | 
    
         
            +
                let(:user1) { User.create!(name: 'user1') }
         
     | 
| 
       16 
17 
     | 
    
         
             
                before do
         
     | 
| 
       17 
     | 
    
         
            -
                  ( 
     | 
| 
      
 18 
     | 
    
         
            +
                  1.upto(5) do |index|
         
     | 
| 
       18 
19 
     | 
    
         
             
                    footprintable = Footprintable.create!(name: "footprintable#{index}")
         
     | 
| 
       19 
20 
     | 
    
         
             
                    second_footprintable = SecondFootprintable.create!(name: "second_footprintable#{index}")
         
     | 
| 
       20 
21 
     | 
    
         
             
                    3.times do
         
     | 
| 
       21 
     | 
    
         
            -
                      footprintable.leave_footprints  
     | 
| 
       22 
     | 
    
         
            -
                      second_footprintable.leave_footprints  
     | 
| 
      
 22 
     | 
    
         
            +
                      footprintable.leave_footprints user1
         
     | 
| 
      
 23 
     | 
    
         
            +
                      second_footprintable.leave_footprints user1
         
     | 
| 
       23 
24 
     | 
    
         
             
                    end
         
     | 
| 
       24 
25 
     | 
    
         
             
                  end
         
     | 
| 
       25 
26 
     | 
    
         
             
                end
         
     | 
| 
       26 
27 
     | 
    
         | 
| 
       27 
     | 
    
         
            -
                describe  
     | 
| 
       28 
     | 
    
         
            -
                  it  
     | 
| 
       29 
     | 
    
         
            -
                    expect( 
     | 
| 
       30 
     | 
    
         
            -
                     
     | 
| 
      
 28 
     | 
    
         
            +
                describe '対象のモデル毎に' do
         
     | 
| 
      
 29 
     | 
    
         
            +
                  it '取得できること' do
         
     | 
| 
      
 30 
     | 
    
         
            +
                    expect(user1.access_histories_for(Footprintable).count).must_equal 5
         
     | 
| 
      
 31 
     | 
    
         
            +
                    expected_data = 5.downto(1).map { |i| "footprintable#{i}" }
         
     | 
| 
      
 32 
     | 
    
         
            +
                    expect(user1.access_histories_for(Footprintable).map(&:footprintable).pluck(:name)).must_equal expected_data
         
     | 
| 
       31 
33 
     | 
    
         
             
                  end
         
     | 
| 
       32 
34 
     | 
    
         | 
| 
       33 
     | 
    
         
            -
                  it  
     | 
| 
       34 
     | 
    
         
            -
                    expect( 
     | 
| 
       35 
     | 
    
         
            -
                     
     | 
| 
      
 35 
     | 
    
         
            +
                  it '件数を絞り込めること' do
         
     | 
| 
      
 36 
     | 
    
         
            +
                    expect(user1.access_histories_for(Footprintable, 3).count).must_equal 3
         
     | 
| 
      
 37 
     | 
    
         
            +
                    expected_data = 5.downto(3).map { |i| "footprintable#{i}" }
         
     | 
| 
      
 38 
     | 
    
         
            +
                    expect(user1.access_histories_for(Footprintable, 3).map(&:footprintable).pluck(:name)).must_equal expected_data
         
     | 
| 
       36 
39 
     | 
    
         
             
                  end
         
     | 
| 
       37 
40 
     | 
    
         
             
                end
         
     | 
| 
       38 
41 
     | 
    
         | 
| 
       39 
     | 
    
         
            -
                describe  
     | 
| 
       40 
     | 
    
         
            -
                  it  
     | 
| 
       41 
     | 
    
         
            -
                    expect( 
     | 
| 
       42 
     | 
    
         
            -
                    footprintable_names = (1 
     | 
| 
      
 42 
     | 
    
         
            +
                describe '全てのモデルを通じて' do
         
     | 
| 
      
 43 
     | 
    
         
            +
                  it '取得できること' do
         
     | 
| 
      
 44 
     | 
    
         
            +
                    expect(user1.access_histories.count).must_equal 10
         
     | 
| 
      
 45 
     | 
    
         
            +
                    footprintable_names = 5.downto(1).each_with_object([]) do |index, results|
         
     | 
| 
       43 
46 
     | 
    
         
             
                      results.push "second_footprintable#{index}"
         
     | 
| 
       44 
47 
     | 
    
         
             
                      results.push "footprintable#{index}"
         
     | 
| 
       45 
     | 
    
         
            -
                      results
         
     | 
| 
       46 
48 
     | 
    
         
             
                    end
         
     | 
| 
       47 
     | 
    
         
            -
                    expect( 
     | 
| 
      
 49 
     | 
    
         
            +
                    expect(user1.access_histories.map(&:footprintable).pluck(:name)).must_equal footprintable_names
         
     | 
| 
       48 
50 
     | 
    
         
             
                  end
         
     | 
| 
       49 
51 
     | 
    
         | 
| 
       50 
     | 
    
         
            -
                  it  
     | 
| 
       51 
     | 
    
         
            -
                    expect( 
     | 
| 
      
 52 
     | 
    
         
            +
                  it '件数を絞り込める事' do
         
     | 
| 
      
 53 
     | 
    
         
            +
                    expect(user1.access_histories(3).count).must_equal 3
         
     | 
| 
       52 
54 
     | 
    
         
             
                  end
         
     | 
| 
       53 
55 
     | 
    
         
             
                end
         
     | 
| 
       54 
56 
     | 
    
         | 
| 
       55 
57 
     | 
    
         
             
                describe 'アクセス履歴のないユーザーの場合' do
         
     | 
| 
       56 
     | 
    
         
            -
                  let(: 
     | 
| 
      
 58 
     | 
    
         
            +
                  let(:user2) { User.create!(name: 'user2') }
         
     | 
| 
       57 
59 
     | 
    
         
             
                  it '件数が0件であること' do
         
     | 
| 
       58 
     | 
    
         
            -
                    expect( 
     | 
| 
      
 60 
     | 
    
         
            +
                    expect(user2.access_histories_for(Footprintable).count).must_equal 0
         
     | 
| 
       59 
61 
     | 
    
         
             
                  end
         
     | 
| 
       60 
62 
     | 
    
         
             
                end
         
     | 
| 
       61 
63 
     | 
    
         
             
              end
         
     | 
    
        data/test/test_helper.rb
    CHANGED
    
    | 
         @@ -1,53 +1,58 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       1 
3 
     | 
    
         
             
            require 'minitest/autorun'
         
     | 
| 
       2 
4 
     | 
    
         
             
            require 'active_record'
         
     | 
| 
      
 5 
     | 
    
         
            +
            require 'active_support/testing/time_helpers'
         
     | 
| 
      
 6 
     | 
    
         
            +
            # database_cleaner 1~2系のどちらでも動くようにするため、パスを修正
         
     | 
| 
      
 7 
     | 
    
         
            +
            require 'database_cleaner'
         
     | 
| 
      
 8 
     | 
    
         
            +
            require 'acts_as_footprintable'
         
     | 
| 
       3 
9 
     | 
    
         | 
| 
       4 
     | 
    
         
            -
            require  
     | 
| 
       5 
     | 
    
         
            -
            require "acts_as_footprintable"
         
     | 
| 
       6 
     | 
    
         
            -
            require 'timecop'
         
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
            Dir["#{Dir.pwd}/test/internal/app/models/*.rb"].each(&method(:require))
         
     | 
| 
      
 10 
     | 
    
         
            +
            Dir["#{Dir.pwd}/test/internal/app/models/*.rb"].sort.each { |f| require f }
         
     | 
| 
       9 
11 
     | 
    
         | 
| 
       10 
12 
     | 
    
         
             
            ActiveRecord::Base.establish_connection('adapter' => 'sqlite3', 'database' => ':memory:')
         
     | 
| 
       11 
13 
     | 
    
         
             
            ActiveRecord::Schema.define do
         
     | 
| 
       12 
     | 
    
         
            -
              create_table :footprints, : 
     | 
| 
       13 
     | 
    
         
            -
                t.references :footprintable, : 
     | 
| 
       14 
     | 
    
         
            -
                t.references :footprinter, : 
     | 
| 
       15 
     | 
    
         
            -
                t.timestamps : 
     | 
| 
      
 14 
     | 
    
         
            +
              create_table :footprints, force: true do |t|
         
     | 
| 
      
 15 
     | 
    
         
            +
                t.references :footprintable, polymorphic: true
         
     | 
| 
      
 16 
     | 
    
         
            +
                t.references :footprinter, polymorphic: true
         
     | 
| 
      
 17 
     | 
    
         
            +
                t.timestamps null: false
         
     | 
| 
       16 
18 
     | 
    
         
             
              end
         
     | 
| 
       17 
19 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
              add_index :footprints, [ 
     | 
| 
       19 
     | 
    
         
            -
              add_index :footprints, [ 
     | 
| 
      
 20 
     | 
    
         
            +
              add_index :footprints, %i[footprintable_id footprintable_type]
         
     | 
| 
      
 21 
     | 
    
         
            +
              add_index :footprints, %i[footprinter_id footprinter_type]
         
     | 
| 
       20 
22 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
              create_table :users, : 
     | 
| 
      
 23 
     | 
    
         
            +
              create_table :users, force: true do |t|
         
     | 
| 
       22 
24 
     | 
    
         
             
                t.string :name
         
     | 
| 
       23 
25 
     | 
    
         
             
              end
         
     | 
| 
       24 
26 
     | 
    
         | 
| 
       25 
     | 
    
         
            -
              create_table :not_users, : 
     | 
| 
      
 27 
     | 
    
         
            +
              create_table :not_users, force: true do |t|
         
     | 
| 
       26 
28 
     | 
    
         
             
                t.string :name
         
     | 
| 
       27 
29 
     | 
    
         
             
              end
         
     | 
| 
       28 
30 
     | 
    
         | 
| 
       29 
     | 
    
         
            -
              create_table :footprintables, : 
     | 
| 
      
 31 
     | 
    
         
            +
              create_table :footprintables, force: true do |t|
         
     | 
| 
       30 
32 
     | 
    
         
             
                t.string :name
         
     | 
| 
       31 
33 
     | 
    
         
             
              end
         
     | 
| 
       32 
34 
     | 
    
         | 
| 
       33 
     | 
    
         
            -
              create_table :second_footprintables, : 
     | 
| 
      
 35 
     | 
    
         
            +
              create_table :second_footprintables, force: true do |t|
         
     | 
| 
       34 
36 
     | 
    
         
             
                t.string :name
         
     | 
| 
       35 
37 
     | 
    
         
             
              end
         
     | 
| 
       36 
38 
     | 
    
         | 
| 
       37 
     | 
    
         
            -
              create_table :not_footprintables, : 
     | 
| 
      
 39 
     | 
    
         
            +
              create_table :not_footprintables, force: true do |t|
         
     | 
| 
       38 
40 
     | 
    
         
             
                t.string :name
         
     | 
| 
       39 
41 
     | 
    
         
             
              end
         
     | 
| 
       40 
42 
     | 
    
         
             
            end
         
     | 
| 
       41 
43 
     | 
    
         | 
| 
       42 
44 
     | 
    
         
             
            DatabaseCleaner.strategy = :transaction
         
     | 
| 
       43 
45 
     | 
    
         | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
      
 46 
     | 
    
         
            +
            module Minitest
         
     | 
| 
      
 47 
     | 
    
         
            +
              class Spec
         
     | 
| 
      
 48 
     | 
    
         
            +
                include ActiveSupport::Testing::TimeHelpers
         
     | 
| 
       45 
49 
     | 
    
         | 
| 
       46 
     | 
    
         
            -
             
     | 
| 
       47 
     | 
    
         
            -
             
     | 
| 
       48 
     | 
    
         
            -
             
     | 
| 
      
 50 
     | 
    
         
            +
                before :each do
         
     | 
| 
      
 51 
     | 
    
         
            +
                  DatabaseCleaner.start
         
     | 
| 
      
 52 
     | 
    
         
            +
                end
         
     | 
| 
       49 
53 
     | 
    
         | 
| 
       50 
     | 
    
         
            -
             
     | 
| 
       51 
     | 
    
         
            -
             
     | 
| 
      
 54 
     | 
    
         
            +
                after :each do
         
     | 
| 
      
 55 
     | 
    
         
            +
                  DatabaseCleaner.clean
         
     | 
| 
      
 56 
     | 
    
         
            +
                end
         
     | 
| 
       52 
57 
     | 
    
         
             
              end
         
     | 
| 
       53 
58 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,15 +1,69 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: acts_as_footprintable
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.6. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.6.3
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Toyoaki Oko
         
     | 
| 
       8 
     | 
    
         
            -
            autorequire: 
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2025-06-19 00:00:00.000000000 Z
         
     | 
| 
       12 
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: 7.2.0
         
     | 
| 
      
 20 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 21 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 22 
     | 
    
         
            +
                    version: 5.0.0
         
     | 
| 
      
 23 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 24 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 25 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 26 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 27 
     | 
    
         
            +
                - - "<"
         
     | 
| 
      
 28 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 29 
     | 
    
         
            +
                    version: 7.2.0
         
     | 
| 
      
 30 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 31 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 32 
     | 
    
         
            +
                    version: 5.0.0
         
     | 
| 
      
 33 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 34 
     | 
    
         
            +
              name: concurrent-ruby
         
     | 
| 
      
 35 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 36 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 37 
     | 
    
         
            +
                - - '='
         
     | 
| 
      
 38 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 39 
     | 
    
         
            +
                    version: 1.3.4
         
     | 
| 
      
 40 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 41 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 42 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 43 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 44 
     | 
    
         
            +
                - - '='
         
     | 
| 
      
 45 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 46 
     | 
    
         
            +
                    version: 1.3.4
         
     | 
| 
      
 47 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 48 
     | 
    
         
            +
              name: database_cleaner
         
     | 
| 
      
 49 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 50 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 51 
     | 
    
         
            +
                - - "<"
         
     | 
| 
      
 52 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 53 
     | 
    
         
            +
                    version: '3.0'
         
     | 
| 
      
 54 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 55 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 56 
     | 
    
         
            +
                    version: 1.99.0
         
     | 
| 
      
 57 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 58 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 59 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 60 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 61 
     | 
    
         
            +
                - - "<"
         
     | 
| 
      
 62 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 63 
     | 
    
         
            +
                    version: '3.0'
         
     | 
| 
      
 64 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 65 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 66 
     | 
    
         
            +
                    version: 1.99.0
         
     | 
| 
       13 
67 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
68 
     | 
    
         
             
              name: rake
         
     | 
| 
       15 
69 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -25,33 +79,123 @@ dependencies: 
     | 
|
| 
       25 
79 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       26 
80 
     | 
    
         
             
                    version: '13.0'
         
     | 
| 
       27 
81 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       28 
     | 
    
         
            -
              name:  
     | 
| 
      
 82 
     | 
    
         
            +
              name: rubocop
         
     | 
| 
       29 
83 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       30 
84 
     | 
    
         
             
                requirements:
         
     | 
| 
       31 
85 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       32 
86 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       33 
     | 
    
         
            -
                    version: ' 
     | 
| 
      
 87 
     | 
    
         
            +
                    version: '1.24'
         
     | 
| 
       34 
88 
     | 
    
         
             
              type: :development
         
     | 
| 
       35 
89 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       36 
90 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       37 
91 
     | 
    
         
             
                requirements:
         
     | 
| 
       38 
92 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       39 
93 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       40 
     | 
    
         
            -
                    version: ' 
     | 
| 
      
 94 
     | 
    
         
            +
                    version: '1.24'
         
     | 
| 
       41 
95 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       42 
     | 
    
         
            -
              name:  
     | 
| 
      
 96 
     | 
    
         
            +
              name: rubocop-minitest
         
     | 
| 
       43 
97 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       44 
98 
     | 
    
         
             
                requirements:
         
     | 
| 
       45 
99 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       46 
100 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       47 
     | 
    
         
            -
                    version: ' 
     | 
| 
      
 101 
     | 
    
         
            +
                    version: '0.17'
         
     | 
| 
       48 
102 
     | 
    
         
             
              type: :development
         
     | 
| 
       49 
103 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       50 
104 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       51 
105 
     | 
    
         
             
                requirements:
         
     | 
| 
       52 
106 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       53 
107 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       54 
     | 
    
         
            -
                    version: ' 
     | 
| 
      
 108 
     | 
    
         
            +
                    version: '0.17'
         
     | 
| 
      
 109 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 110 
     | 
    
         
            +
              name: rubocop-performance
         
     | 
| 
      
 111 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 112 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 113 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 114 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 115 
     | 
    
         
            +
                    version: '1.13'
         
     | 
| 
      
 116 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 117 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 118 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 119 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 120 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 121 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 122 
     | 
    
         
            +
                    version: '1.13'
         
     | 
| 
      
 123 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 124 
     | 
    
         
            +
              name: rubocop-rake
         
     | 
| 
      
 125 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 126 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 127 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 128 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 129 
     | 
    
         
            +
                    version: '0.6'
         
     | 
| 
      
 130 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 131 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 132 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 133 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 134 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 135 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 136 
     | 
    
         
            +
                    version: '0.6'
         
     | 
| 
      
 137 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 138 
     | 
    
         
            +
              name: sqlite3
         
     | 
| 
      
 139 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 140 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 141 
     | 
    
         
            +
                - - "<"
         
     | 
| 
      
 142 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 143 
     | 
    
         
            +
                    version: '3.0'
         
     | 
| 
      
 144 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 145 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 146 
     | 
    
         
            +
                    version: '1.3'
         
     | 
| 
      
 147 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 148 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 149 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 150 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 151 
     | 
    
         
            +
                - - "<"
         
     | 
| 
      
 152 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 153 
     | 
    
         
            +
                    version: '3.0'
         
     | 
| 
      
 154 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 155 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 156 
     | 
    
         
            +
                    version: '1.3'
         
     | 
| 
      
 157 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 158 
     | 
    
         
            +
              name: mutex_m
         
     | 
| 
      
 159 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 160 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 161 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 162 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 163 
     | 
    
         
            +
                    version: '0.1'
         
     | 
| 
      
 164 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 165 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 166 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 167 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 168 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 169 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 170 
     | 
    
         
            +
                    version: '0.1'
         
     | 
| 
      
 171 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 172 
     | 
    
         
            +
              name: bigdecimal
         
     | 
| 
      
 173 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 174 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 175 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 176 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 177 
     | 
    
         
            +
                    version: '3.0'
         
     | 
| 
      
 178 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 179 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 180 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 181 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 182 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 183 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 184 
     | 
    
         
            +
                    version: '3.0'
         
     | 
| 
      
 185 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 186 
     | 
    
         
            +
              name: base64
         
     | 
| 
      
 187 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 188 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 189 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 190 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 191 
     | 
    
         
            +
                    version: '0.1'
         
     | 
| 
      
 192 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 193 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 194 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 195 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 196 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 197 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 198 
     | 
    
         
            +
                    version: '0.1'
         
     | 
| 
       55 
199 
     | 
    
         
             
            description: Rails gem to allowing records to leave footprints
         
     | 
| 
       56 
200 
     | 
    
         
             
            email: chariderpato@gmail.com
         
     | 
| 
       57 
201 
     | 
    
         
             
            executables: []
         
     | 
| 
         @@ -61,6 +205,7 @@ files: 
     | 
|
| 
       61 
205 
     | 
    
         
             
            - ".github/workflows/gem-push.yml"
         
     | 
| 
       62 
206 
     | 
    
         
             
            - ".github/workflows/test.yml"
         
     | 
| 
       63 
207 
     | 
    
         
             
            - ".gitignore"
         
     | 
| 
      
 208 
     | 
    
         
            +
            - ".rubocop.yml"
         
     | 
| 
       64 
209 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       65 
210 
     | 
    
         
             
            - LICENSE.txt
         
     | 
| 
       66 
211 
     | 
    
         
             
            - README.md
         
     | 
| 
         @@ -73,6 +218,7 @@ files: 
     | 
|
| 
       73 
218 
     | 
    
         
             
            - gemfiles/rails_6.0.gemfile
         
     | 
| 
       74 
219 
     | 
    
         
             
            - gemfiles/rails_6.1.gemfile
         
     | 
| 
       75 
220 
     | 
    
         
             
            - gemfiles/rails_7.0.gemfile
         
     | 
| 
      
 221 
     | 
    
         
            +
            - gemfiles/rails_7.1.gemfile
         
     | 
| 
       76 
222 
     | 
    
         
             
            - lib/acts_as_footprintable.rb
         
     | 
| 
       77 
223 
     | 
    
         
             
            - lib/acts_as_footprintable/extenders/footprintable.rb
         
     | 
| 
       78 
224 
     | 
    
         
             
            - lib/acts_as_footprintable/extenders/footprinter.rb
         
     | 
| 
         @@ -93,8 +239,9 @@ files: 
     | 
|
| 
       93 
239 
     | 
    
         
             
            homepage: https://github.com/patorash/acts_as_footprintable
         
     | 
| 
       94 
240 
     | 
    
         
             
            licenses:
         
     | 
| 
       95 
241 
     | 
    
         
             
            - MIT
         
     | 
| 
       96 
     | 
    
         
            -
            metadata: 
     | 
| 
       97 
     | 
    
         
            -
             
     | 
| 
      
 242 
     | 
    
         
            +
            metadata:
         
     | 
| 
      
 243 
     | 
    
         
            +
              rubygems_mfa_required: 'true'
         
     | 
| 
      
 244 
     | 
    
         
            +
            post_install_message:
         
     | 
| 
       98 
245 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       99 
246 
     | 
    
         
             
            require_paths:
         
     | 
| 
       100 
247 
     | 
    
         
             
            - lib
         
     | 
| 
         @@ -102,15 +249,15 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       102 
249 
     | 
    
         
             
              requirements:
         
     | 
| 
       103 
250 
     | 
    
         
             
              - - ">="
         
     | 
| 
       104 
251 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       105 
     | 
    
         
            -
                  version: ' 
     | 
| 
      
 252 
     | 
    
         
            +
                  version: '2.6'
         
     | 
| 
       106 
253 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       107 
254 
     | 
    
         
             
              requirements:
         
     | 
| 
       108 
255 
     | 
    
         
             
              - - ">="
         
     | 
| 
       109 
256 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       110 
257 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       111 
258 
     | 
    
         
             
            requirements: []
         
     | 
| 
       112 
     | 
    
         
            -
            rubygems_version: 3. 
     | 
| 
       113 
     | 
    
         
            -
            signing_key: 
     | 
| 
      
 259 
     | 
    
         
            +
            rubygems_version: 3.3.27
         
     | 
| 
      
 260 
     | 
    
         
            +
            signing_key:
         
     | 
| 
       114 
261 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       115 
262 
     | 
    
         
             
            summary: Rails gem to allowing records to leave footprints
         
     | 
| 
       116 
263 
     | 
    
         
             
            test_files:
         
     |