acts-as-messageable 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc
CHANGED
@@ -9,7 +9,7 @@ To use it, add it to your Gemfile:
|
|
9
9
|
|
10
10
|
== Post instalation
|
11
11
|
|
12
|
-
rails g
|
12
|
+
rails g acts-as-messageable:migration [table_name] # default 'messages'
|
13
13
|
rake db:migrate
|
14
14
|
|
15
15
|
== Usage
|
@@ -28,12 +28,16 @@ To use it, add it to your Gemfile:
|
|
28
28
|
@bob.send_message(@alice, "Re: Message topic", "Hi alice!")
|
29
29
|
|
30
30
|
== New API
|
31
|
+
|
31
32
|
@alice.messages -- all messages connected with @alice (inbox/outbox)
|
33
|
+
@alice.received_messages -- @alice inbox
|
34
|
+
@alice.sent_messages -- @alice outbox
|
35
|
+
|
32
36
|
@alice.deleted_messages -- all messages connected with @alice (trash)
|
33
37
|
|
34
38
|
@alice.messages.are_from(@bob) -- all message form @bob
|
35
39
|
@alice.messages.are_to(@bob) -- all message to @bob
|
36
|
-
@alice.messages.
|
40
|
+
@alice.messages.with_id(@id_of_message) -- message with id id_of_message
|
37
41
|
@alice.messages.readed -- all readed @alice messages
|
38
42
|
@alice.messages.unaded -- all unreaded @alice messages
|
39
43
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/acts-as-messageable.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{acts-as-messageable}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Piotr Nielacny"]
|
12
|
-
s.date = %q{2011-05-
|
12
|
+
s.date = %q{2011-05-05}
|
13
13
|
s.email = %q{piotr.nielacny@gmail.com}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"README.rdoc"
|
@@ -18,7 +18,7 @@ module ActsAsMessageable
|
|
18
18
|
# Sample documentation for scope
|
19
19
|
scope :are_from, lambda { |*args| where("sent_messageable_id = :sender", :sender => args.first) }
|
20
20
|
scope :are_to, lambda { |*args| where("received_messageable_id = :receiver", :receiver => args.first) }
|
21
|
-
scope :
|
21
|
+
scope :with_id, lambda { |*args| where("id = :id", :id => args.first) }
|
22
22
|
|
23
23
|
scope :connected_with, lambda { |*args| where("(sent_messageable_type = :sent_type and
|
24
24
|
sent_messageable_id = :sent_id and
|
@@ -5,6 +5,8 @@ module ActsAsMessageable
|
|
5
5
|
class MigrationGenerator < Rails::Generators::Base
|
6
6
|
include Rails::Generators::Migration
|
7
7
|
|
8
|
+
namespace "acts-as-messageable:migration"
|
9
|
+
|
8
10
|
source_root File.join(File.dirname(__FILE__), 'templates')
|
9
11
|
argument :table_name, :type => :string, :default => "messages"
|
10
12
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts-as-messageable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-05-
|
12
|
+
date: 2011-05-05 00:00:00.000000000 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
17
|
-
requirement: &
|
17
|
+
requirement: &14917040 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 3.0.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *14917040
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rspec
|
28
|
-
requirement: &
|
28
|
+
requirement: &14916280 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 2.3.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *14916280
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: bundler
|
39
|
-
requirement: &
|
39
|
+
requirement: &14914600 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: 1.0.0
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *14914600
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: jeweler
|
50
|
-
requirement: &
|
50
|
+
requirement: &14912820 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ~>
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: 1.6.0
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *14912820
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: rcov
|
61
|
-
requirement: &
|
61
|
+
requirement: &14911500 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ! '>='
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: '0'
|
67
67
|
type: :development
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *14911500
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: sqlite3-ruby
|
72
|
-
requirement: &
|
72
|
+
requirement: &14909060 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ! '>='
|
@@ -77,7 +77,7 @@ dependencies:
|
|
77
77
|
version: '0'
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *14909060
|
81
81
|
description:
|
82
82
|
email: piotr.nielacny@gmail.com
|
83
83
|
executables: []
|
@@ -116,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: '0'
|
117
117
|
segments:
|
118
118
|
- 0
|
119
|
-
hash:
|
119
|
+
hash: 4493248086086979425
|
120
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
121
|
none: false
|
122
122
|
requirements:
|