Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

elight-acts_as_commentable_with_threading

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elight-acts_as_commentable_with_threading

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
3
Created
Source

Acts As Commentable

Allows for threaded comments to be added to multiple and different models. Drop-in compatible for acts_as_commentable (however requiring a database schema change)

== Resources

Install

Rails

  • To install as a plugin:
script/plugin install http://github.com/jackdempsey/acts_as_commentable

Merb/Rails

  • To install as a gem:

rake install

  • Create a new rails migration and add the following self.up and self.down methods

def self.up create_table "comments", :force => true do |t| t.integer "commentable_id", :default => 0 t.string "commentable_type", :limit => 15, :default => "" t.string "title", :default => "" t.text "body", :default => "" t.string "subject", :default => "" t.integer "user_id", :default => 0, :null => false t.integer "parent_id" t.integer "lft" t.integer "rgt" t.timestamps end

add_index "comments", "user_id"
add_index "comments", "commentable_id"

end

def self.down drop_table :comments end

== Usage class Model < ActiveRecord::Base acts_as_commentable_with_threading end

  • Add a comment to a model instance

model = Model.new comment = Comment.new(:model => model, :body => "Your comment text here") comment.save! comment.move_to_child_of(the_desired_parent_comment)

Following doesn't work/make sense to me. Leaving for historical sake -- Jack

* Each comment reference commentable object

model = Model.find(1)

model.comments.get(0).commentable == model

== Credits

Jack Dempsey - This plugin/gem is heavily influenced/liberally borrowed/stole from acts_as_commentable

which in turn credits....

Xelipe - Because acts_as_commentable was heavily influenced by Acts As Taggable.

== More

http://triple-dog-dare.com http://evan.tiggerpalace.com

FAQs

Package last updated on 11 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc