commentem 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.
data/Manifest CHANGED
@@ -1,6 +1,6 @@
1
- Manifest
2
1
  README.rdoc
3
2
  Rakefile
3
+ commentem.gemspec
4
4
  init.rb
5
5
  lib/commentem.rb
6
6
  lib/commentem/commentable.rb
@@ -8,3 +8,4 @@ lib/commentem/commenter.rb
8
8
  lib/generators/commentem_generator.rb
9
9
  lib/generators/templates/migration.rb
10
10
  lib/generators/templates/model.rb
11
+ Manifest
data/README.rdoc CHANGED
@@ -65,4 +65,18 @@ Just add `acts_as_commenter` and `acts_as_commentable` to your models. You could
65
65
 
66
66
  @user.comments # retrieve all comments from @user, including on @user2 and @post
67
67
  @user.comments_on(@user2) # same as @user2.comments
68
- @user.comments_on(@post) # same as @post.comments
68
+ @user.comments_on(@post) # same as @post.comments
69
+
70
+ == Change Logs
71
+
72
+ Version 1.0.2
73
+
74
+ - Updated the code of the comment model to use class methods instead of scopes (don't worry, no any change to the usage).
75
+
76
+ Version 1.0.1
77
+
78
+ - Updated the Readme file.
79
+
80
+ Version 1.0.0
81
+
82
+ - The Commentem gem is published with basic necessary functionalities (commenting and querying).
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('commentem', '1.0.1') do |p|
5
+ Echoe.new('commentem', '1.0.2') do |p|
6
6
  p.description = "A generic commenting system."
7
7
  p.url = "http://github.com/peterwongpp/Commentem"
8
8
  p.author = "Peter Wong"
data/commentem.gemspec CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{commentem}
5
- s.version = "1.0.1"
5
+ s.version = "1.0.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Peter Wong"]
9
- s.date = %q{2011-05-20}
9
+ s.date = %q{2011-06-04}
10
10
  s.description = %q{A generic commenting system.}
11
11
  s.email = %q{peter@peterwongpp.com}
12
12
  s.extra_rdoc_files = ["README.rdoc", "lib/commentem.rb", "lib/commentem/commentable.rb", "lib/commentem/commenter.rb", "lib/generators/commentem_generator.rb", "lib/generators/templates/migration.rb", "lib/generators/templates/model.rb"]
13
- s.files = ["Manifest", "README.rdoc", "Rakefile", "init.rb", "lib/commentem.rb", "lib/commentem/commentable.rb", "lib/commentem/commenter.rb", "lib/generators/commentem_generator.rb", "lib/generators/templates/migration.rb", "lib/generators/templates/model.rb", "commentem.gemspec"]
13
+ s.files = ["README.rdoc", "Rakefile", "commentem.gemspec", "init.rb", "lib/commentem.rb", "lib/commentem/commentable.rb", "lib/commentem/commenter.rb", "lib/generators/commentem_generator.rb", "lib/generators/templates/migration.rb", "lib/generators/templates/model.rb", "Manifest"]
14
14
  s.homepage = %q{http://github.com/peterwongpp/Commentem}
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Commentem", "--main", "README.rdoc"]
16
16
  s.require_paths = ["lib"]
@@ -1,7 +1,14 @@
1
1
  class Comment < ActiveRecord::Base
2
- scope :comments_by, lambda { |commenter| where(["commenter_id = ? AND commenter_type = ?", commenter.id, commenter.class.name]) }
3
- scope :comments_on, lambda { |commentable| where(["commentable_id = ? AND commentable_type = ?", commentable.id, commentable.class.name]) }
4
-
5
2
  belongs_to :commenter, :polymorphic => true
6
3
  belongs_to :commentable, :polymorphic => true
4
+
5
+ class << self
6
+ def comments_by(commenter)
7
+ where(["commenter_id = ? AND commenter_type = ?", commenter.id, commenter.class.name])
8
+ end
9
+
10
+ def comments_on(commentable)
11
+ where(["commentable_id = ? AND commentable_type = ?", commentable.id, commentable.class.name)
12
+ end
13
+ end
7
14
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 1
9
- version: 1.0.1
8
+ - 2
9
+ version: 1.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Peter Wong
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-05-20 00:00:00 +08:00
17
+ date: 2011-06-04 00:00:00 +08:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
@@ -33,9 +33,9 @@ extra_rdoc_files:
33
33
  - lib/generators/templates/migration.rb
34
34
  - lib/generators/templates/model.rb
35
35
  files:
36
- - Manifest
37
36
  - README.rdoc
38
37
  - Rakefile
38
+ - commentem.gemspec
39
39
  - init.rb
40
40
  - lib/commentem.rb
41
41
  - lib/commentem/commentable.rb
@@ -43,7 +43,7 @@ files:
43
43
  - lib/generators/commentem_generator.rb
44
44
  - lib/generators/templates/migration.rb
45
45
  - lib/generators/templates/model.rb
46
- - commentem.gemspec
46
+ - Manifest
47
47
  has_rdoc: true
48
48
  homepage: http://github.com/peterwongpp/Commentem
49
49
  licenses: []