acts_as_metable 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +39 -0
- data/lib/acts_as_metable/metable.rb +2 -2
- data/lib/acts_as_metable/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4fde97be2ab1080457824a617aaf8cd91acaeeb
|
4
|
+
data.tar.gz: 180ede078992c92f479772f33a531ebcdb19fdb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 605bde5e4d15d0d86233c31512c7690852e10247ceccc738dbc6005200990569e582eff7358b425e182b7ffb16d872be12d7e2ffbc88fad2eaae87ad43938bfd
|
7
|
+
data.tar.gz: e911fef4978f1f3e6dc4ef9d1f4291fab562fca85bf480026ceff048beef7a080995cdee6bfdd4f7837e838782a7610290fb090771a5592bec087dbe1d968ce4
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# Acts As Metable
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/acts_as_metable.svg)](http://badge.fury.io/rb/acts_as_metable)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/droptheplot/acts_as_metable/badges/gpa.svg)](https://codeclimate.com/github/droptheplot/acts_as_metable)
|
5
|
+
|
6
|
+
Meta tags from polymorphic model
|
7
|
+
|
8
|
+
## Getting started
|
9
|
+
|
10
|
+
Add gem to your Gemfile
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
gem 'acts_as_metable'
|
14
|
+
```
|
15
|
+
|
16
|
+
Bundle it
|
17
|
+
|
18
|
+
```shell
|
19
|
+
bundle install
|
20
|
+
```
|
21
|
+
|
22
|
+
Run the installer
|
23
|
+
|
24
|
+
```shell
|
25
|
+
rails g acts_as_metable:install
|
26
|
+
```
|
27
|
+
|
28
|
+
Then migrations
|
29
|
+
```shell
|
30
|
+
rake db:migrate
|
31
|
+
```
|
32
|
+
|
33
|
+
Add `acts_as_metable` method to your model
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
class Page < ActiveRecord::Base
|
37
|
+
acts_as_metable
|
38
|
+
end
|
39
|
+
```
|
@@ -1,8 +1,8 @@
|
|
1
|
-
module ActsAsMetable
|
1
|
+
module ::ActsAsMetable
|
2
2
|
module Metable
|
3
3
|
def acts_as_metable
|
4
4
|
class_eval do
|
5
|
-
has_many :meta_tags,
|
5
|
+
has_many :meta_tags, dependent: :destroy, class_name: '::ActsAsMetable::Tag', :foreign_key => :metable_id
|
6
6
|
end
|
7
7
|
end
|
8
8
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_metable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Novikov
|
@@ -46,6 +46,7 @@ extensions: []
|
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
48
|
- MIT-LICENSE
|
49
|
+
- README.md
|
49
50
|
- Rakefile
|
50
51
|
- app/models/acts_as_metable/tag.rb
|
51
52
|
- db/migrate/20150913104251_create_acts_as_metable_tags.rb
|