simple_hashtag 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/simple_hashtag/hashtaggable.rb +1 -1
- data/lib/simple_hashtag/version.rb +1 -1
- data/spec/simple_hashtag_spec.rb +13 -0
- metadata +3 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f74385407506567775c9750d7c0c0434b15e311
|
4
|
+
data.tar.gz: def878f47d6bdae51390f41cc41c0c04a79efaa1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e67cd65399f564f71007b41752af1fd59b3db710f1cecd41debc84901026b8341e0651b837ec324e815cbe67aee72cbf6d1bfdcf1f7a2570eea1016796654781
|
7
|
+
data.tar.gz: c19ffe78748575c22745795070842979077c89d2654583fd2f36a64836dd00c2c8d5028d193aa2ce0a870cae36630007110d2eb953b4b07fb2d522aa7fbffeb1
|
@@ -3,7 +3,7 @@ module SimpleHashtag
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
included do
|
6
|
-
has_many :hashtaggings, as: :hashtaggable, class_name: "SimpleHashtag::Hashtagging"
|
6
|
+
has_many :hashtaggings, as: :hashtaggable, class_name: "SimpleHashtag::Hashtagging", dependent: :destroy
|
7
7
|
has_many :hashtags, through: :hashtaggings, class_name: "SimpleHashtag::Hashtag"
|
8
8
|
|
9
9
|
before_save :update_hashtags
|
data/spec/simple_hashtag_spec.rb
CHANGED
@@ -62,7 +62,20 @@ describe SimpleHashtag do
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
+
it "is destroyed whith parent" do
|
66
|
+
ActiveRecord::Base.subclasses.each(&:delete_all)
|
67
|
+
Post.create(body: "Certainty of death, small chance of #success.")
|
68
|
+
Post.create(body: "Certainty of death, small chance of #success.")
|
69
|
+
p = Post.last
|
70
|
+
p.destroy
|
71
|
+
|
72
|
+
tag = SimpleHashtag::Hashtag.find_by_name("success")
|
73
|
+
tag.hashtaggables.size.should eq 1
|
74
|
+
tag.hashtaggings.size.should eq 1
|
75
|
+
end
|
76
|
+
|
65
77
|
it "can clean the DB from orphan tags" do
|
78
|
+
ActiveRecord::Base.subclasses.each(&:delete_all)
|
66
79
|
Post.create(body: "Certainty of death, small #chance of success.")
|
67
80
|
p = Post.last
|
68
81
|
p.body = "What are we #waiting for?"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_hashtag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raphael Campardou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -141,7 +141,6 @@ files:
|
|
141
141
|
- spec/dummy/db/schema.rb
|
142
142
|
- spec/dummy/lib/assets/.gitkeep
|
143
143
|
- spec/dummy/log/.gitkeep
|
144
|
-
- spec/dummy/log/development.log
|
145
144
|
- spec/dummy/public/404.html
|
146
145
|
- spec/dummy/public/422.html
|
147
146
|
- spec/dummy/public/500.html
|
@@ -169,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
168
|
version: '0'
|
170
169
|
requirements: []
|
171
170
|
rubyforge_project:
|
172
|
-
rubygems_version: 2.1.
|
171
|
+
rubygems_version: 2.1.9
|
173
172
|
signing_key:
|
174
173
|
specification_version: 4
|
175
174
|
summary: Simple Hashtag is a mix between–well–hashtags as we know them and categories.
|
@@ -209,7 +208,6 @@ test_files:
|
|
209
208
|
- spec/dummy/db/schema.rb
|
210
209
|
- spec/dummy/lib/assets/.gitkeep
|
211
210
|
- spec/dummy/log/.gitkeep
|
212
|
-
- spec/dummy/log/development.log
|
213
211
|
- spec/dummy/public/404.html
|
214
212
|
- spec/dummy/public/422.html
|
215
213
|
- spec/dummy/public/500.html
|