Skip to content

Instantly share code, notes, and snippets.

@gavinhughes
Created November 23, 2010 11:59
Show Gist options
  • Save gavinhughes/711653 to your computer and use it in GitHub Desktop.
Save gavinhughes/711653 to your computer and use it in GitHub Desktop.
Conversation: concept for a internal messaging gem
= conversation
Conversation is a Ruby gem that gives your Rails 3 application messaging and commenting features.
Messages and comments can be configured to be either threaded or unthreaded. Any number of models
can be messageable, commentable, or both. You make a model messageable like this
class User < ActiveRecord::Base
messageable
end
which will produce routes like these:
user_messages_path
user_message_path
new_user_message_path
delete_user_message_path
Along with the routes, you also get views and some basic styling to get you started.
Messages can be actionable. An actionable message is one that solicits an action from the recipient
in the body of a message. The action might be a feedback form or a request for payment or any other
action that you wish to associate with that message.
Conversation also gives your application commenting. You make a model commentable like this
class Photo < ActiveRecord::Base
commentable
end
which will produce routes like these:
photo_comments_path
photo_comment_path
new_photo_comment_path
delete_photo_comment_path
Conversation provides many partials and helpers so you can instantly start adding comments to any model
in your application.
Messaging and commenting have many configuration options. See the documention for details.
== Installation
1. Add "conversation" to your gem file.
2. Bundle install
3. For messaging, "rails generate messageable +model_name+"
4. For commenting, "rails generate commentable +model_name+"
== Contributing to conversation
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been
fixed yet
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
* Fork the project
* Start a feature/bugfix branch
* Commit and push until you are happy with your contribution
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or
is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
== Copyright
Copyright (c) 2010 Gavin Hughes. See LICENSE.txt for
further details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment