From 6768d86e5f9a306a0dd2059b6cd6e6e1b89e5458 Mon Sep 17 00:00:00 2001 From: Washington Botelho Date: Fri, 29 Dec 2017 14:00:52 -0200 Subject: [PATCH] v1.1.0 --- CHANGELOG.md | 5 +++++ Gemfile.lock | 2 +- README.md | 23 +++++++++++++++++++++++ lib/normalizy/version.rb | 2 +- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3810df3..06d2795 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v1.1.0 + +- Features: + - Added `slug` filter with option to apply the value on other field. + ## v1.0.1 - Fixes: diff --git a/Gemfile.lock b/Gemfile.lock index a253c7c..c0a4028 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - normalizy (1.0.1) + normalizy (1.1.0) rails (>= 4.1, < 6) GEM diff --git a/README.md b/README.md index ef2b51c..e41893b 100644 --- a/README.md +++ b/README.md @@ -343,6 +343,29 @@ normalizy :amount, with: { percent: { cast: :to_f, type: :integer } } # 4200.0 ``` +### Slug + +Convert texto to slug. + +```ruby +normalizy :slug, with: :slug +'Washington é Botelho' +# 'washington-e-botelho' +``` + +#### to + +You can slug a field based on other just sending the result value. + +```ruby +normalizy :title, with: { slug: { to: :slug } } + +model.title = 'Washington é Botelho' + +model.slug +# 'washington-e-botelho' +``` + ### Strip Cleans edge spaces. diff --git a/lib/normalizy/version.rb b/lib/normalizy/version.rb index ae8a01c..855d2f5 100644 --- a/lib/normalizy/version.rb +++ b/lib/normalizy/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Normalizy - VERSION = '1.0.1' + VERSION = '1.1.0' end