<commit_before># Connections

Most social apps need some kind of follow/like/watch/stalk/etc
features that connects one model to another.

Instead of having to recreate this functionality for every project I
decided to create a gem that easily allows you to add these features
using any naming you prefer.

## Installation

Add the gem to the gemfile:
`gem "connections"`

Install migration:
`rake connections:install:migrations`

This generates a migration that creates a single join table for
keeping track of what is connected to what.

## Usage

Use `connects_with` to enable a model to connect to other models and
`connectable_with ` to allow a model to be connected to using
whatever naming scheme you prefer (follow, like, watch, etc)

    class User < ActiveRecord::Base
      connects_with :follow, :like
      connectable_with :follow
    end

    class Post < ActiveRecord::Base
      connectable_with :like
    end
<commit_msg>Added travis badge.<commit_after># Connections

Most social apps need some kind of follow/like/watch/stalk/etc
features that connects one model to another.

Instead of having to recreate this functionality for every project I
decided to create a gem that easily allows you to add these features
using any naming you prefer.

[![Build Status](https://secure.travis-ci.org/balvig/connections.png?branch=master)](http://travis-ci.org/balvig/connections)

## Installation

Add the gem to the gemfile:
`gem "connections"`

Install migration:
`rake connections:install:migrations`

This generates a migration that creates a single join table for
keeping track of what is connected to what.

## Usage

Use `connects_with` to enable a model to connect to other models and
`connectable_with ` to allow a model to be connected to using
whatever naming scheme you prefer (follow, like, watch, etc)

    class User < ActiveRecord::Base
      connects_with :follow, :like
      connectable_with :follow
    end

    class Post < ActiveRecord::Base
      connectable_with :like
    end

{'fraction_non_alphanumeric': 0.058677274987568376, 'fraction_numerical': 0.0, 'mean_word_length': 4.253263707571802, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '586192', 'n_tokens_mistral': 551, 'n_tokens_neox': 526, 'n_words': 254}