README.md in metka-1.0.2 vs README.md in metka-1.0.3

- old
+ new

@@ -2,11 +2,11 @@ [![Build Status](https://travis-ci.org/jetrockets/metka.svg?branch=master)](https://travis-ci.org/jetrockets/metka) [![Open Source Helpers](https://www.codetriage.com/jetrockets/metka/badges/users.svg)](https://www.codetriage.com/jetrockets/metka) # Metka -Rails gem to manage tags with SonggreSQL array columns. +Rails gem to manage tags with PostgreSQL array columns. ## Installation Add this line to your application's Gemfile: @@ -45,60 +45,60 @@ class Song < ActiveRecord::Base include Metka::Model(column: 'tags') include Metka::Model(column: 'genres') end -@song = Song.new(title: 'Migrate tags in Rails to SonggreSQL') +@song = Song.new(title: 'Migrate tags in Rails to PostgreSQL') @song.tag_list = 'top, chill' @song.genre_list = 'rock, jazz, pop' @song.save ``` ## Find tagged objects ### .with_all_#{column_name} ```ruby Song.with_all_tags('top') -=> [#<Song id: 1, title: 'Migrate tags in Rails to SonggreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] +=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] Song.with_all_tags('top, 1990') => [] Song.with_all_tags('') => [] Song.with_all_genres('rock') -=> [#<Song id: 1, title: 'Migrate tags in Rails to SonggreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] +=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] ``` ### .with_any_#{column_name} ```ruby Song.with_any_tags('chill') -=> [#<Song id: 1, title: 'Migrate tags in Rails to SonggreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] +=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] Song.with_any_tags('chill, 1980') -=> [#<Song id: 1, title: 'Migrate tags in Rails to SonggreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] +=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] Song.with_any_tags('') => [] Song.with_any_genres('rock, rap') -=> [#<Song id: 1, title: 'Migrate tags in Rails to SonggreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] +=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] ``` ### .without_all_#{column_name} ```ruby Song.without_all_tags('top') => [] Song.without_all_tags('top, 1990') -=> [#<Song id: 1, title: 'Migrate tags in Rails to SonggreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] +=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] Song.without_all_tags('') -=> [#<Song id: 1, title: 'Migrate tags in Rails to SonggreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] +=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] Song.without_all_genres('rock, pop') -=> [#<Song id: 1, title: 'Migrate tags in Rails to SonggreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] +=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] Song.without_all_genres('rock') => [] ``` @@ -106,16 +106,16 @@ ```ruby Song.without_any_tags('top, 1990') => [] Song.without_any_tags('1990, 1980') -=> [#<Song id: 1, title: 'Migrate tags in Rails to SonggreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] +=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] Song.without_any_genres('rock, pop') => [] Song.without_any_genres('') -=> [#<Song id: 1, title: 'Migrate tags in Rails to SonggreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] +=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']] ``` ## Custom delimiter By default, a comma is used as a delimiter to create tags from a string. You can make your own custom separator: