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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92cf359e8763bc3f5110ceecae2df02a19de730e
4
- data.tar.gz: 2745a7c66d0eb823ff9d36291fb081f95b8dc6e8
3
+ metadata.gz: 7f74385407506567775c9750d7c0c0434b15e311
4
+ data.tar.gz: def878f47d6bdae51390f41cc41c0c04a79efaa1
5
5
  SHA512:
6
- metadata.gz: 8310a4c6ae2144c15bde96ff7bcba20ed8f422e8d03d375dc0327ef36e16ce5463bcf2c52ef23b91cd319695c76e9f2476a2cd3d9f4d24d1987ad9a9a5df65e2
7
- data.tar.gz: d0236caaa76693f6244f6b1f8edaf6864e5fc1dc3267b60175344c40e790078057ebf2de94f3f6fc3d1b47b1b94668f369292a9d4c48c3afababe77a8446ba32
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
@@ -1,3 +1,3 @@
1
1
  module SimpleHashtag
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
@@ -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.8
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-10-19 00:00:00.000000000 Z
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.5
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