seoable 0.1.6 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/concerns/seoable/acts_as_seoable.rb +18 -8
- data/lib/seoable/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b96eeef8619519dc135b4895bd15f0554ae6564
|
4
|
+
data.tar.gz: 0423dfe2a7429b258b13801bbbe977239a5b2f8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2942f5b640bb9f31b7f46738b61dcf152bb7ba8178aa0ac37acff85a20e7e106237381db82b5f3324a0969f99c815f3e2bf75592cca29dcdcac1fcbfacdaf8b6
|
7
|
+
data.tar.gz: 4e0df858928f0f78a387cb760fe6cb43124bfddbafbf94dc28b5f13b5c014f1b84ec3d615142319be4f7c9f23782fb55b7fa0f03e83ccc261dc63759dd3edf20
|
@@ -11,20 +11,30 @@ module Seoable
|
|
11
11
|
default_scope { joins_seo_detail }
|
12
12
|
scope :joins_seo_detail, -> { includes(:seo_detail) }
|
13
13
|
|
14
|
-
has_one :seo_detail,
|
15
|
-
as: :seoable,
|
16
|
-
dependent: :destroy,
|
17
|
-
class_name: SeoDetail
|
18
|
-
|
19
|
-
accepts_nested_attributes_for :seo_detail, reject_if: :all_blank
|
20
|
-
|
21
14
|
delegate :meta_title, to: :seo_detail, allow_nil: true
|
15
|
+
delegate :meta_title=, to: :seo_detail, allow_nil: true
|
22
16
|
delegate :meta_description, to: :seo_detail, allow_nil: true
|
17
|
+
delegate :meta_description=, to: :seo_detail, allow_nil: true
|
23
18
|
delegate :slug, to: :seo_detail, allow_nil: true
|
19
|
+
delegate :slug=, to: :seo_detail, allow_nil: true
|
20
|
+
|
21
|
+
after_save do
|
22
|
+
seo_detail.save
|
23
|
+
end
|
24
|
+
|
25
|
+
after_destroy do
|
26
|
+
seo_detail.destroy
|
27
|
+
end
|
28
|
+
|
29
|
+
validate do
|
30
|
+
if seo_detail.invalid?
|
31
|
+
errors.add(:seo_detail, :invalid)
|
32
|
+
end
|
33
|
+
end
|
24
34
|
end
|
25
35
|
|
26
36
|
def seo_detail
|
27
|
-
|
37
|
+
@seo_detail ||= SeoDetail.where(seoable: self).first_or_initialize(seo_detail_attributes)
|
28
38
|
end
|
29
39
|
|
30
40
|
def seo_detail_attributes
|
data/lib/seoable/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seoable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Viktor Fonic
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-01-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: friendly_id
|
@@ -250,4 +250,3 @@ signing_key:
|
|
250
250
|
specification_version: 4
|
251
251
|
summary: Make your webapp Search Engine friendly
|
252
252
|
test_files: []
|
253
|
-
has_rdoc:
|