<commit_before># Sequenced

Sequenced is a simple Rails 3 engine that generates scoped sequential 
IDs for ActiveRecord models. It's generally a bad practice to expose your 
database primary keys to the world in your URLs. Sequenced allows you to 
mitigate this problem by sequencing your models within a particular scope. 

For example, given a Question model that has many Answers, it makes sense
to number answers sequentially within the scope of the parent question. 
You can achieve this with Sequenced in one line of code:

```ruby
class Question < ActiveRecord::Base
  has_many :answers
end

class Answer < ActiveRecord::Base
  belongs_to :question
  acts_as_sequenced :on => :question
end
```

## Installation

First, add the gem to your Gemfile:

```    
gem 'sequenced'
```
    
Then, install and run migrations:

```
rails generate sequenced
rake db:migrate
```

## Usage

To add a sequential ID to a model, first add an integer column called 
`sequential_id` to the model (or you many name the column anything you
like and override the default). For example:

```
rails generate migration add_sequential_id_to_answers sequential_id:integer
rake db:migrate
```

Then, call the `acts_as_sequenced` macro in your model class:

```ruby
class Answer < ActiveRecord::Base
  belongs_to :question
  acts_as_sequenced :on => :question
end
```

### Storing the Sequential ID in a Custom Column

By default, Sequenced uses the `sequential_id` column. If you wish to store the 
sequential ID in different integer column, simply specific the column name with 
the `:column` option:

```ruby
acts_as_sequenced :on => :question, :column => :custom_sequential_id
```

## License
<commit_msg>Fix typo<commit_after># Sequenced

Sequenced is a simple Rails 3 engine that generates scoped sequential 
IDs for ActiveRecord models. It's generally a bad practice to expose your 
database primary keys to the world in your URLs. Sequenced allows you to 
mitigate this problem by sequencing your models within a particular scope. 

For example, given a Question model that has many Answers, it makes sense
to number answers sequentially within the scope of the parent question. 
You can achieve this with Sequenced in one line of code:

```ruby
class Question < ActiveRecord::Base
  has_many :answers
end

class Answer < ActiveRecord::Base
  belongs_to :question
  acts_as_sequenced :on => :question
end
```

## Installation

First, add the gem to your Gemfile:

```    
gem 'sequenced'
```
    
Then, install and run migrations:

```
rails generate sequenced
rake db:migrate
```

## Usage

To add a sequential ID to a model, first add an integer column called 
`sequential_id` to the model (or you many name the column anything you
like and override the default). For example:

```
rails generate migration add_sequential_id_to_answers sequential_id:integer
rake db:migrate
```

Then, call the `acts_as_sequenced` macro in your model class:

```ruby
class Answer < ActiveRecord::Base
  belongs_to :question
  acts_as_sequenced :on => :question
end
```

### Storing the Sequential ID in a Custom Column

By default, Sequenced uses the `sequential_id` column. If you wish to store the 
sequential ID in different integer column, simply specify the column name with 
the `:column` option:

```ruby
acts_as_sequenced :on => :question, :column => :custom_sequential_id
```

## License

{'fraction_non_alphanumeric': 0.06828978622327792, 'fraction_numerical': 0.0005938242280285036, 'mean_word_length': 4.729591836734694, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, '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': '3450379', 'n_tokens_mistral': 993, 'n_tokens_neox': 938, 'n_words': 447}