<commit_before>{<img src="https://badge.fury.io/rb/slugs.png" alt="Gem Version" />}[http://badge.fury.io/rb/slugs] {<img src="https://codeclimate.com/github/museways/slugs.png" />}[https://codeclimate.com/github/museways/slugs] {<img src="https://secure.travis-ci.org/museways/slugs.png?branch=master" alt="Build Status" />}[https://travis-ci.org/museways/slugs]

= Slugs

Minimalistic slugs inspired in friendly_id for rails.

= Install

Put this line in your Gemfile:
  gem 'slugs'

Then bundle:
  $ bundle

= Configuration

Add the slug column to the tables of the models you want to have slugs:
  t.string :slug

Update your db:
  rake db:migrate

NOTE: If you are using translatable_records you need to place the column in the translations table.

= Usage

Use has_slug in your models to define what the slug will be:

If you want to use the value of one field:
  has_slug :prop

To concatenate the value of multiple fields:
  has_slug :prop1, :prop2, :prop3

If you need a very custom slug you can use a lambda, proc or block:
  has_slug proc { |record| "#{record.prop}-custom" }

Then the find method of your models will accept slugs and ids transparently:
  Model.find 'slug'

All the path and urls helpers will start using the slug by default if you want to force the id:
  model_path(instance.id)

= Credits

This gem is maintained and funded by museways[http://museways.com].

= License

It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.<commit_msg>Fix typo<commit_after>{<img src="https://badge.fury.io/rb/slugs.png" alt="Gem Version" />}[http://badge.fury.io/rb/slugs] {<img src="https://codeclimate.com/github/museways/slugs.png" />}[https://codeclimate.com/github/museways/slugs] {<img src="https://secure.travis-ci.org/museways/slugs.png?branch=master" alt="Build Status" />}[https://travis-ci.org/museways/slugs]

= Slugs

Minimalistic slugs inspired in friendly_id for rails.

= Install

Put this line in your Gemfile:
  gem 'slugs'

Then bundle:
  $ bundle

= Configuration

Add the slug column to the tables of the models you want to have slugs:
  t.string :slug

Update your db:
  rake db:migrate

NOTE: If you are using translatable_records you need to place the column in the translations table.

= Usage

Use has_slug in your models to define what the slug will be:

If you want to use the value of one field:
  has_slug :prop

To concatenate the value of multiple fields:
  has_slug :prop1, :prop2, :prop3

If you need a very custom slug you can use a lambda, proc or block:
  has_slug proc { |record| "#{record.prop}-custom" }

Then the find method of your models will accept slugs and ids transparently:
  Model.find 'slug'

All the path and url helpers will start using the slug by default if you want to force the id:
  model_path(instance.id)

= Credits

This gem is maintained and funded by museways[http://museways.com].

= License

It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
{'fraction_non_alphanumeric': 0.09707446808510638, 'fraction_numerical': 0.0019946808510638296, 'mean_word_length': 4.152397260273973, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 10, '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': '5273844', 'n_tokens_mistral': 989, 'n_tokens_neox': 984, 'n_words': 378}