README.md in metka-1.0.0 vs README.md in metka-1.0.1
- old
+ new
@@ -1,5 +1,6 @@
+[![Gem Version](https://badge.fury.io/rb/metka.svg)](https://badge.fury.io/rb/metka)
[![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
@@ -21,19 +22,36 @@
$ gem install metka
## Tag objects
+```bash
+rails g migration CreateSongs
+```
+
```ruby
+class CreateSongs < ActiveRecord::Migration[5.0]
+ def change
+ create_table :songs do |t|
+ t.string :title
+ t.string :tags, array: true
+ t.string :genres, array: true
+ t.timestamps
+ end
+ end
+end
+```
+
+```ruby
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.tag_list = 'top, chill'
-@Song.genre_list = 'rock, jazz, pop'
-@Song.save
+@song = Song.new(title: 'Migrate tags in Rails to SonggreSQL')
+@song.tag_list = 'top, chill'
+@song.genre_list = 'rock, jazz, pop'
+@song.save
```
## Find tagged objects
### .with_all_#{column_name}