acts_as_footprintable 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile +0 -1
- data/lib/acts_as_footprintable/footprinter.rb +1 -2
- data/lib/acts_as_footprintable/version.rb +1 -1
- data/spec/footprinter_spec.rb +2 -2
- metadata +2 -4
- data/spec/internal/log/test.log +0 -96629
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df4d08bc04902b332332c0ff97b6274ff1d8b8ca
|
4
|
+
data.tar.gz: 458cb1b7b03dbb49519a3d8dfec29c6964c26b05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7090d942f039475f207ea89ef6a83f7b45f83ef387a74d8abe4784087a3a7ef9307bc51864c7560502a530b9460dcbee3356636c9df77f05632dec6f6725d6c8
|
7
|
+
data.tar.gz: fedaf2dbea3f98884d2c25b6c3517fbd1516adb156852733f040a1000034d7db5322e7d491a82522783d09f27cec273ab1edc0a47744db54b2405ee022eb0013
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -30,8 +30,7 @@ module ActsAsFootprintable
|
|
30
30
|
|
31
31
|
private
|
32
32
|
def get_access_history_records(target, limit=nil)
|
33
|
-
|
34
|
-
records.map{|footprint| footprint.footprintable}
|
33
|
+
footprints.where(:id => recent_footprint_ids(target, limit)).order("footprints.created_at desc")
|
35
34
|
end
|
36
35
|
|
37
36
|
def table_name
|
data/spec/footprinter_spec.rb
CHANGED
@@ -27,7 +27,7 @@ describe ActsAsFootprintable::Footprinter do
|
|
27
27
|
context "対象のモデル毎に" do
|
28
28
|
it "取得できること" do
|
29
29
|
@user.access_histories_for(Footprintable).should have(5).items
|
30
|
-
@user.access_histories_for(Footprintable).map{|
|
30
|
+
@user.access_histories_for(Footprintable).map{|footprint| footprint.footprintable.name}.should == (1..5).to_a.reverse.map{|index| "footprintable#{index}"}
|
31
31
|
end
|
32
32
|
|
33
33
|
it "件数を絞り込めること" do
|
@@ -38,7 +38,7 @@ describe ActsAsFootprintable::Footprinter do
|
|
38
38
|
context "全てのモデルを通じて" do
|
39
39
|
it "取得できること" do
|
40
40
|
@user.access_histories.should have(10).items
|
41
|
-
@user.access_histories.map{|
|
41
|
+
@user.access_histories.map{|footprint| footprint.footprintable.name}.should == (1..5).to_a.reverse.inject([]) do |results, index|
|
42
42
|
results.push "second_footprintable#{index}"
|
43
43
|
results.push "footprintable#{index}"
|
44
44
|
results
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_footprintable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
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-
|
11
|
+
date: 2013-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -140,7 +140,6 @@ files:
|
|
140
140
|
- spec/internal/app/models/user.rb
|
141
141
|
- spec/internal/config/database.yml
|
142
142
|
- spec/internal/db/schema.rb
|
143
|
-
- spec/internal/log/test.log
|
144
143
|
- spec/spec_helper.rb
|
145
144
|
homepage: https://github.com/patorash/acts_as_footprintable
|
146
145
|
licenses:
|
@@ -176,5 +175,4 @@ test_files:
|
|
176
175
|
- spec/internal/app/models/user.rb
|
177
176
|
- spec/internal/config/database.yml
|
178
177
|
- spec/internal/db/schema.rb
|
179
|
-
- spec/internal/log/test.log
|
180
178
|
- spec/spec_helper.rb
|