yoomee-acts_as_mongo_taggable 0.2.2 → 0.2.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.
Files changed (3) hide show
  1. data/Rakefile +4 -4
  2. data/lib/acts_as_mongo_taggable.rb +12 -19
  3. metadata +7 -9
data/Rakefile CHANGED
@@ -23,11 +23,11 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
23
23
  end
24
24
 
25
25
  begin
26
- GEM = "acts_as_mongo_taggable"
27
- AUTHOR = "Matt E. Patterson"
28
- EMAIL = "mpatterson@ngenera.com"
26
+ GEM = "yoomee-acts_as_mongo_taggable"
27
+ AUTHOR = "Matt Atkins, Matt E. Patterson"
28
+ EMAIL = "matt@yoomee.com, mpatterson@ngenera.com"
29
29
  SUMMARY = "A ruby gem for acts_as_taggable to mongo"
30
- HOMEPAGE = "http://github.com/mepatterson/acts_as_mongo_taggable"
30
+ HOMEPAGE = "http://github.com/Yoomee/acts_as_mongo_taggable"
31
31
 
32
32
  gem 'jeweler', '>= 1.0.0'
33
33
  require 'jeweler'
@@ -178,25 +178,18 @@ module ActsAsMongoTaggable
178
178
  tags
179
179
  end
180
180
 
181
- # tags anonymously, not associated with user. Doesn't allow duplicate tags.
182
- # NOTE: automatically downcases each word unless you manually specify :case_sensitive=>true
183
- # def tag(word_or_words, opts={})
184
- # arr_of_words(word_or_words).each do |word|
185
- # word = word.downcase unless opts[:case_sensitive] == true
186
- # unless model_tags.any?{|tag| tag.word == word}
187
- # #First add Tag/Tagging
188
- # t = Tag.first(:word => word) || Tag.create!(:word => word)
189
- # t.taggings << Tagging.new(:taggable => self)
190
- # t.save
191
- #
192
- # model_tag = ModelTag.new(:word => word, :tag => t)
193
- # self.model_tags << model_tag
194
- # self.tag_words << word
195
- # end
196
- # end
197
- # save
198
- # tags
199
- # end
181
+ def untag(word_or_words, options={})
182
+ return 0 if model_tags.blank?
183
+ arr_of_words(word_or_words).each do |word|
184
+ word = word.downcase unless options[:case_sensitive] == true
185
+ tag = Tag.first(:word => word)
186
+ tagging_for_deletion = t.taggings.select{|tagging| tagging.taggable_type == self.class.name && tagging.taggable_id == self.id}.first
187
+ tag.taggings.delete tagging_for_deletion
188
+ tag.save_or_destroy
189
+ end
190
+ save
191
+ reload
192
+ end
200
193
 
201
194
 
202
195
  # returns the Rating object found if user has rated this project, else returns nil
metadata CHANGED
@@ -1,23 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yoomee-acts_as_mongo_taggable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 2
10
- version: 0.2.2
9
+ - 3
10
+ version: 0.2.3
11
11
  platform: ruby
12
12
  authors:
13
- - Ian Mooney
14
- - Matt Atkins
15
- - Matt E. Patterson
13
+ - Matt Atkins, Matt E. Patterson
16
14
  autorequire:
17
15
  bindir: bin
18
16
  cert_chain: []
19
17
 
20
- date: 2010-08-17 00:00:00 +01:00
18
+ date: 2010-08-25 00:00:00 +01:00
21
19
  default_executable:
22
20
  dependencies:
23
21
  - !ruby/object:Gem::Dependency
@@ -37,7 +35,7 @@ dependencies:
37
35
  type: :runtime
38
36
  version_requirements: *id001
39
37
  description: A ruby gem for acts_as_taggable to mongo
40
- email: matt@yoomee.com
38
+ email: matt@yoomee.com, mpatterson@ngenera.com
41
39
  executables: []
42
40
 
43
41
  extensions: []
@@ -56,7 +54,7 @@ files:
56
54
  - test/acts_as_mongo_taggable_test.rb
57
55
  - test/test_helper.rb
58
56
  has_rdoc: true
59
- homepage: http://github.com/yoomee/acts_as_mongo_taggable
57
+ homepage: http://github.com/Yoomee/acts_as_mongo_taggable
60
58
  licenses: []
61
59
 
62
60
  post_install_message: