acts_as_footprintable 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df4d08bc04902b332332c0ff97b6274ff1d8b8ca
4
- data.tar.gz: 458cb1b7b03dbb49519a3d8dfec29c6964c26b05
3
+ metadata.gz: fc9280a30690056a250801e928173079736e8d31
4
+ data.tar.gz: 5c7a079403b3a2bec4686dd885d51872d85b3ae0
5
5
  SHA512:
6
- metadata.gz: 7090d942f039475f207ea89ef6a83f7b45f83ef387a74d8abe4784087a3a7ef9307bc51864c7560502a530b9460dcbee3356636c9df77f05632dec6f6725d6c8
7
- data.tar.gz: fedaf2dbea3f98884d2c25b6c3517fbd1516adb156852733f040a1000034d7db5322e7d491a82522783d09f27cec273ab1edc0a47744db54b2405ee022eb0013
6
+ metadata.gz: 14df9393a2ab8708884564d186907f8655b1edb414fad55e90528333aefdce293c12e3bdf3f333f9e4eba2877000daea192e48b59ab30d27cfa5c2f228965eef
7
+ data.tar.gz: bad6e2bc48854594db1f4507431a80660a0164e972778b9b1f5cb3471a4f742e2333449502a07639ac7c697510198ef2ca9efe4dbd472f7acdeaa69d98d0b778
data/.travis.yml CHANGED
@@ -5,3 +5,7 @@ rvm:
5
5
  env:
6
6
  - "RAILS_VERSION=4.0.0"
7
7
  - "RAILS_VERSION=3.2.0"
8
+ branches:
9
+ only:
10
+ - master
11
+ - travis
data/Gemfile CHANGED
@@ -16,3 +16,6 @@ rails = case rails_version
16
16
  end
17
17
 
18
18
  gem 'rails', rails
19
+ group :development do
20
+ gem 'combustion', github: 'patorash/combustion', branch: 'master'
21
+ end
@@ -24,5 +24,5 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency 'pg'
25
25
  spec.add_development_dependency 'timecop'
26
26
  spec.add_development_dependency 'database_cleaner', "~> 1.0.1"
27
- spec.add_development_dependency 'combustion', '~> 0.3.3'
27
+ #spec.add_development_dependency 'combustion', '~> 0.5.1'
28
28
  end
@@ -30,7 +30,7 @@ module ActsAsFootprintable
30
30
 
31
31
  private
32
32
  def get_access_history_records(target, limit=nil)
33
- footprints.where(:id => recent_footprint_ids(target, limit)).order("footprints.created_at desc")
33
+ footprints.where(:id => recent_footprint_ids(target, limit))
34
34
  end
35
35
 
36
36
  def table_name
@@ -41,6 +41,7 @@ module ActsAsFootprintable
41
41
  recent_footprints = target.group("#{table_name}.footprintable_id, #{table_name}.footprintable_type").
42
42
  select("#{table_name}.footprintable_id, #{table_name}.footprintable_type, MAX(#{table_name}.created_at)")
43
43
  records = footprints.where("(#{table_name}.footprintable_id, #{table_name}.footprintable_type, #{table_name}.created_at) IN (#{recent_footprints.arel.to_sql})")
44
+ records = records.order("footprints.created_at desc")
44
45
  records = records.limit(limit) unless limit.nil?
45
46
  records.pluck(:id)
46
47
  end
@@ -1,4 +1,4 @@
1
1
  # coding: utf-8
2
2
  module ActsAsFootprintable
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
@@ -1,5 +1,6 @@
1
1
  # coding: utf-8
2
2
  require 'spec_helper'
3
+ require 'acts_as_footprintable/footprinter'
3
4
 
4
5
  describe ActsAsFootprintable::Footprinter do
5
6
 
@@ -32,6 +33,7 @@ describe ActsAsFootprintable::Footprinter do
32
33
 
33
34
  it "件数を絞り込めること" do
34
35
  @user.access_histories_for(Footprintable, 3).should have(3).items
36
+ @user.access_histories_for(Footprintable, 3).map{|footprint| footprint.footprintable.name}.should == (3..5).to_a.reverse.map{|index| "footprintable#{index}"}
35
37
  end
36
38
  end
37
39
 
@@ -0,0 +1 @@
1
+ *.log
data/spec/spec_helper.rb CHANGED
@@ -1,9 +1,9 @@
1
1
  ## coding: utf-8
2
2
  require 'rubygems'
3
- require 'bundler'
4
- require 'active_support/dependencies'
5
-
6
- Bundler.require :default, :development
3
+ require 'bundler/setup'
4
+ require 'combustion'
5
+ require 'database_cleaner'
6
+ require 'timecop'
7
7
 
8
8
  Combustion.initialize! :active_record
9
9
 
metadata CHANGED
@@ -1,122 +1,108 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_footprintable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toyoaki Oko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-09 00:00:00.000000000 Z
11
+ date: 2014-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pg
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: timecop
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: database_cleaner
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: 1.0.1
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: 1.0.1
97
- - !ruby/object:Gem::Dependency
98
- name: combustion
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ~>
102
- - !ruby/object:Gem::Version
103
- version: 0.3.3
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ~>
109
- - !ruby/object:Gem::Version
110
- version: 0.3.3
111
97
  description: Rails gem to allowing records to leave footprints
112
98
  email: chariderpato@gmail.com
113
99
  executables: []
114
100
  extensions: []
115
101
  extra_rdoc_files: []
116
102
  files:
117
- - .gitignore
118
- - .rspec
119
- - .travis.yml
103
+ - ".gitignore"
104
+ - ".rspec"
105
+ - ".travis.yml"
120
106
  - Gemfile
121
107
  - LICENSE.txt
122
108
  - README.md
@@ -140,6 +126,7 @@ files:
140
126
  - spec/internal/app/models/user.rb
141
127
  - spec/internal/config/database.yml
142
128
  - spec/internal/db/schema.rb
129
+ - spec/internal/log/.gitignore
143
130
  - spec/spec_helper.rb
144
131
  homepage: https://github.com/patorash/acts_as_footprintable
145
132
  licenses:
@@ -151,17 +138,17 @@ require_paths:
151
138
  - lib
152
139
  required_ruby_version: !ruby/object:Gem::Requirement
153
140
  requirements:
154
- - - '>='
141
+ - - ">="
155
142
  - !ruby/object:Gem::Version
156
143
  version: '0'
157
144
  required_rubygems_version: !ruby/object:Gem::Requirement
158
145
  requirements:
159
- - - '>='
146
+ - - ">="
160
147
  - !ruby/object:Gem::Version
161
148
  version: '0'
162
149
  requirements: []
163
150
  rubyforge_project:
164
- rubygems_version: 2.0.5
151
+ rubygems_version: 2.2.2
165
152
  signing_key:
166
153
  specification_version: 4
167
154
  summary: Rails gem to allowing records to leave footprints
@@ -175,4 +162,6 @@ test_files:
175
162
  - spec/internal/app/models/user.rb
176
163
  - spec/internal/config/database.yml
177
164
  - spec/internal/db/schema.rb
165
+ - spec/internal/log/.gitignore
178
166
  - spec/spec_helper.rb
167
+ has_rdoc: