<commit_before>[![Gem Version](https://badge.fury.io/rb/has_dynamic_columns.svg)](http://badge.fury.io/rb/has_dynamic_columns)
[![Build Status](https://travis-ci.org/butchmarshall/has_dynamic_columns.svg?branch=master)](https://travis-ci.org/butchmarshall/has_dynamic_columns)

has_dynamic_columns
============

This plugin gives ActiveRecord models the ability to dynamically define collectable data based on ***has_many*** and ***belongs_to*** relationships.

Release Notes
============

**0.3.5**
 - Added model storage type (for storing association with other activerecord objects)

**0.3.4**
 - Can now store array of data
 - JRuby support

**0.3.0**
 - Moved to storing data types in separate tables (where/order now correct!)
 - Added order.by_dynamic_columns
 - Improved how joins were built to avoid duplicates
 - Added ActiveRecord 3 and 4 compatibility

Installation
============

```ruby
gem "has_dynamic_columns"
```

The Active Record migration is required to create the has_dynamic_columns table. You can create that table by
running the following command:

    rails generate has_dynamic_columns:active_record
	rails generate has_dynamic_columns:upgrade_0_3_0_active_record
	rails generate has_dynamic_columns:upgrade_0_3_4_active_record
    rake db:migrate

Usage
============

has_dynamic_columns

 - as: 
	 - the setter/getter method
 - field_scope:
	 - **belongs_to** or **has_many** relationship 

## **belongs_to** relationship

Our example is a data model where an **account** ***has_many*** **customers** and each **customer** ***has_many*** **customer_addresses**

Each customers collectable info is uniquely defined by the associated account.

Each customer addresses collectable info is defined by the associated customers account.
<commit_msg>Forgot to update readme for migration<commit_after>[![Gem Version](https://badge.fury.io/rb/has_dynamic_columns.svg)](http://badge.fury.io/rb/has_dynamic_columns)
[![Build Status](https://travis-ci.org/butchmarshall/has_dynamic_columns.svg?branch=master)](https://travis-ci.org/butchmarshall/has_dynamic_columns)

has_dynamic_columns
============

This plugin gives ActiveRecord models the ability to dynamically define collectable data based on ***has_many*** and ***belongs_to*** relationships.

Release Notes
============

**0.3.5**
 - Added model storage type (for storing association with other activerecord objects)

**0.3.4**
 - Can now store array of data
 - JRuby support

**0.3.0**
 - Moved to storing data types in separate tables (where/order now correct!)
 - Added order.by_dynamic_columns
 - Improved how joins were built to avoid duplicates
 - Added ActiveRecord 3 and 4 compatibility

Installation
============

```ruby
gem "has_dynamic_columns"
```

The Active Record migration is required to create the has_dynamic_columns table. You can create that table by
running the following command:

    rails generate has_dynamic_columns:active_record
	rails generate has_dynamic_columns:upgrade_0_3_0_active_record
	rails generate has_dynamic_columns:upgrade_0_3_4_active_record
	rails generate has_dynamic_columns:upgrade_0_3_5_active_record
    rake db:migrate

Usage
============

has_dynamic_columns

 - as: 
	 - the setter/getter method
 - field_scope:
	 - **belongs_to** or **has_many** relationship 

## **belongs_to** relationship

Our example is a data model where an **account** ***has_many*** **customers** and each **customer** ***has_many*** **customer_addresses**

Each customers collectable info is uniquely defined by the associated account.

Each customer addresses collectable info is defined by the associated customers account.

{'fraction_non_alphanumeric': 0.11652892561983472, 'fraction_numerical': 0.010192837465564738, 'mean_word_length': 5.577898550724638, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, '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': '2511033', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1020, 'n_words': 332}