acts-as-messageable 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +5 -0
- data/Gemfile +2 -2
- data/README.md +18 -6
- data/VERSION +1 -1
- data/acts-as-messageable.gemspec +12 -9
- data/gemfiles/Gemfile-3.0 +6 -0
- data/gemfiles/Gemfile-3.1 +6 -0
- data/gemfiles/Gemfile-3.2 +6 -0
- data/lib/acts-as-messageable/model.rb +7 -1
- metadata +23 -20
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,25 +1,31 @@
|
|
1
|
-
|
2
1
|
ActsAsMessageable
|
3
2
|
=================
|
4
3
|
|
5
4
|
The Acts As Messageable allows communication between the models.
|
6
5
|
|
7
|
-
[![Build Status](
|
6
|
+
[![Build Status](https://secure.travis-ci.org/LTe/acts-as-messageable.png)](http://travis-ci.org/LTe/acts-as-messageable) [![Dependency Status](https://gemnasium.com/LTe/acts-as-messageable.png)](https://gemnasium.com/LTe/acts-as-messageable)
|
8
7
|
|
9
8
|
Usage
|
10
9
|
=====
|
11
10
|
|
12
11
|
To use it, add it to your Gemfile:
|
13
12
|
|
14
|
-
|
13
|
+
### Rails 3
|
14
|
+
|
15
15
|
```ruby
|
16
16
|
gem 'acts-as-messageable'
|
17
17
|
```
|
18
18
|
|
19
|
-
|
19
|
+
### Rails 2
|
20
|
+
|
20
21
|
Use this [fork](http://github.com/openfirmware/acts-as-messageable)
|
21
22
|
Thanks for [@openfirmware](http://github.com/openfirmware)
|
22
23
|
|
24
|
+
```ruby
|
25
|
+
gem 'acts-as-messageable', :git => 'git://github.com/openfirmware/acts-as-messageable.git',
|
26
|
+
:branch => 'rails2.3.11_compatible'
|
27
|
+
```
|
28
|
+
|
23
29
|
Post instalation
|
24
30
|
================
|
25
31
|
|
@@ -83,13 +89,13 @@ class User < ActiveRecord::Base
|
|
83
89
|
end
|
84
90
|
```
|
85
91
|
|
86
|
-
##
|
92
|
+
## With hash
|
87
93
|
|
88
94
|
```ruby
|
89
95
|
@alice.send_message(@bob, { :body => "Hash body" })
|
90
96
|
```
|
91
97
|
|
92
|
-
##
|
98
|
+
## Normal
|
93
99
|
|
94
100
|
```ruby
|
95
101
|
@alice.send_message(@bob, "body")
|
@@ -123,6 +129,12 @@ Conversation
|
|
123
129
|
@message.reply("Re: Hello bob!", "I'm fine")
|
124
130
|
```
|
125
131
|
|
132
|
+
**Or with hash**
|
133
|
+
|
134
|
+
```ruby
|
135
|
+
@message.reply(:topic => "Re: Hello bob!", :body => "I'm fine")
|
136
|
+
```
|
137
|
+
|
126
138
|
**Or in old style**
|
127
139
|
|
128
140
|
```ruby
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.5
|
data/acts-as-messageable.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "acts-as-messageable"
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.5"
|
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 = "2012-
|
12
|
+
s.date = "2012-02-08"
|
13
13
|
s.email = "piotr.nielacny@gmail.com"
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"README.md"
|
@@ -23,6 +23,9 @@ Gem::Specification.new do |s|
|
|
23
23
|
"Rakefile",
|
24
24
|
"VERSION",
|
25
25
|
"acts-as-messageable.gemspec",
|
26
|
+
"gemfiles/Gemfile-3.0",
|
27
|
+
"gemfiles/Gemfile-3.1",
|
28
|
+
"gemfiles/Gemfile-3.2",
|
26
29
|
"lib/acts-as-messageable.rb",
|
27
30
|
"lib/acts-as-messageable/acts-as-messageable.rb",
|
28
31
|
"lib/acts-as-messageable/message.rb",
|
@@ -43,7 +46,7 @@ Gem::Specification.new do |s|
|
|
43
46
|
]
|
44
47
|
s.homepage = "http://github.com/LTe/acts-as-messageable"
|
45
48
|
s.require_paths = ["lib"]
|
46
|
-
s.rubygems_version = "1.8.
|
49
|
+
s.rubygems_version = "1.8.15"
|
47
50
|
s.summary = "Make user messageable!;-)"
|
48
51
|
|
49
52
|
if s.respond_to? :specification_version then
|
@@ -54,16 +57,16 @@ Gem::Specification.new do |s|
|
|
54
57
|
s.add_runtime_dependency(%q<activesupport>, [">= 3.0.0"])
|
55
58
|
s.add_runtime_dependency(%q<ancestry>, ["~> 1.2.4"])
|
56
59
|
s.add_runtime_dependency(%q<railties>, [">= 3.0.0"])
|
57
|
-
s.add_development_dependency(%q<rspec>, ["~> 2.
|
58
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.
|
60
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
|
61
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.7.0"])
|
59
62
|
s.add_development_dependency(%q<sqlite3-ruby>, [">= 0"])
|
60
63
|
else
|
61
64
|
s.add_dependency(%q<activerecord>, [">= 3.0.0"])
|
62
65
|
s.add_dependency(%q<activesupport>, [">= 3.0.0"])
|
63
66
|
s.add_dependency(%q<ancestry>, ["~> 1.2.4"])
|
64
67
|
s.add_dependency(%q<railties>, [">= 3.0.0"])
|
65
|
-
s.add_dependency(%q<rspec>, ["~> 2.
|
66
|
-
s.add_dependency(%q<jeweler>, ["~> 1.
|
68
|
+
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
69
|
+
s.add_dependency(%q<jeweler>, ["~> 1.7.0"])
|
67
70
|
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
68
71
|
end
|
69
72
|
else
|
@@ -71,8 +74,8 @@ Gem::Specification.new do |s|
|
|
71
74
|
s.add_dependency(%q<activesupport>, [">= 3.0.0"])
|
72
75
|
s.add_dependency(%q<ancestry>, ["~> 1.2.4"])
|
73
76
|
s.add_dependency(%q<railties>, [">= 3.0.0"])
|
74
|
-
s.add_dependency(%q<rspec>, ["~> 2.
|
75
|
-
s.add_dependency(%q<jeweler>, ["~> 1.
|
77
|
+
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
78
|
+
s.add_dependency(%q<jeweler>, ["~> 1.7.0"])
|
76
79
|
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
77
80
|
end
|
78
81
|
end
|
@@ -21,7 +21,13 @@ module ActsAsMessageable
|
|
21
21
|
:dependent => :nullify
|
22
22
|
|
23
23
|
self.messages_class_name = (options[:class_name] || "ActsAsMessageable::Message").constantize
|
24
|
-
|
24
|
+
|
25
|
+
if self.messages_class_name.respond_to?(:table_name=)
|
26
|
+
self.messages_class_name.table_name = (options[:table_name] || "messages")
|
27
|
+
else
|
28
|
+
self.messages_class_name.set_table_name(options[:table_name] || "messages")
|
29
|
+
ActiveSupport::Deprecation.warn("Calling set_table_name is deprecated. Please use `self.table_name = 'the_name'` instead.")
|
30
|
+
end
|
25
31
|
|
26
32
|
if options[:required].is_a? Symbol
|
27
33
|
self.messages_class_name.required = [options[:required]]
|
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.4.
|
4
|
+
version: 0.4.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-02-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
16
|
-
requirement: &
|
16
|
+
requirement: &32872620 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.0.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *32872620
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activesupport
|
27
|
-
requirement: &
|
27
|
+
requirement: &32872120 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 3.0.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *32872120
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: ancestry
|
38
|
-
requirement: &
|
38
|
+
requirement: &32871640 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.2.4
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *32871640
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: railties
|
49
|
-
requirement: &
|
49
|
+
requirement: &32871100 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,32 +54,32 @@ dependencies:
|
|
54
54
|
version: 3.0.0
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *32871100
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rspec
|
60
|
-
requirement: &
|
60
|
+
requirement: &32870560 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: 2.
|
65
|
+
version: 2.8.0
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *32870560
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: jeweler
|
71
|
-
requirement: &
|
71
|
+
requirement: &32869960 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: 1.
|
76
|
+
version: 1.7.0
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *32869960
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: sqlite3-ruby
|
82
|
-
requirement: &
|
82
|
+
requirement: &32869380 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *32869380
|
91
91
|
description:
|
92
92
|
email: piotr.nielacny@gmail.com
|
93
93
|
executables: []
|
@@ -103,6 +103,9 @@ files:
|
|
103
103
|
- Rakefile
|
104
104
|
- VERSION
|
105
105
|
- acts-as-messageable.gemspec
|
106
|
+
- gemfiles/Gemfile-3.0
|
107
|
+
- gemfiles/Gemfile-3.1
|
108
|
+
- gemfiles/Gemfile-3.2
|
106
109
|
- lib/acts-as-messageable.rb
|
107
110
|
- lib/acts-as-messageable/acts-as-messageable.rb
|
108
111
|
- lib/acts-as-messageable/message.rb
|
@@ -134,7 +137,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
134
137
|
version: '0'
|
135
138
|
segments:
|
136
139
|
- 0
|
137
|
-
hash: -
|
140
|
+
hash: -1660593036637960416
|
138
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
139
142
|
none: false
|
140
143
|
requirements:
|
@@ -143,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
146
|
version: '0'
|
144
147
|
requirements: []
|
145
148
|
rubyforge_project:
|
146
|
-
rubygems_version: 1.8.
|
149
|
+
rubygems_version: 1.8.15
|
147
150
|
signing_key:
|
148
151
|
specification_version: 3
|
149
152
|
summary: Make user messageable!;-)
|