mm-commentable 1.0.1 → 1.0.2

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.
@@ -30,7 +30,7 @@ You must implement the on_add_comment callback! - however it can be an empty imp
30
30
  @post = Post.create
31
31
  @commentor = User.create
32
32
 
33
- @post.add_comment("great post..", @user)
33
+ @post.add_comment!("great post..", @user)
34
34
 
35
35
  @post.comments_count = 1
36
36
  @posts.comments = [<Comment>]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -26,9 +26,8 @@ module MongoMapper
26
26
  return false unless comment.valid?
27
27
 
28
28
  self.increment('comments_count' => 1)
29
- on_add_comment(comment)
30
29
 
31
- true
30
+ on_add_comment(comment)
32
31
  end
33
32
 
34
33
  def on_add_comment(comment)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mm-commentable}
8
- s.version = "1.0.1"
8
+ s.version = "1.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Luke Cunningham"]
12
- s.date = %q{2010-11-17}
12
+ s.date = %q{2010-11-18}
13
13
  s.description = %q{A very simple mongomapper plugin to make you models commentable}
14
14
  s.email = %q{luke@icaruswings.com}
15
15
  s.extra_rdoc_files = [
@@ -15,7 +15,7 @@ describe "MongoMapper::Plugins::ActsAsCommentable" do
15
15
  @commentable.comments_count.should equal 0
16
16
  end
17
17
 
18
- describe "add_vote!" do
18
+ describe "add_comment!" do
19
19
 
20
20
  it "should increment the comments_count attribute" do
21
21
  lambda {
@@ -16,36 +16,6 @@ require 'mm-commentable'
16
16
  # in ./support/ and its subdirectories.
17
17
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
18
18
 
19
- def Doc(name=nil, &block)
20
- klass = Class.new do
21
- include MongoMapper::Document
22
- set_collection_name :test
23
-
24
- if name
25
- class_eval "def self.name; '#{name}' end"
26
- class_eval "def self.to_s; '#{name}' end"
27
- end
28
- end
29
-
30
- klass.class_eval(&block) if block_given?
31
- klass.collection.remove
32
- klass
33
- end
34
-
35
- def EDoc(name=nil, &block)
36
- klass = Class.new do
37
- include MongoMapper::EmbeddedDocument
38
-
39
- if name
40
- class_eval "def self.name; '#{name}' end"
41
- class_eval "def self.to_s; '#{name}' end"
42
- end
43
- end
44
-
45
- klass.class_eval(&block) if block_given?
46
- klass
47
- end
48
-
49
19
  log_dir = File.expand_path('../../log', __FILE__)
50
20
  FileUtils.mkdir_p(log_dir) unless File.exist?(log_dir)
51
21
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mm-commentable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 1
10
- version: 1.0.1
9
+ - 2
10
+ version: 1.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Luke Cunningham
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-17 00:00:00 +11:00
18
+ date: 2010-11-18 00:00:00 +11:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency