contentful_rails 0.0.8 → 0.0.9
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/lib/contentful_rails/sluggable.rb +20 -0
- data/lib/contentful_rails/version.rb +1 -1
- data/lib/contentful_rails.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9952955574499fc5fd15c613dc0650c2d68d6be4
|
4
|
+
data.tar.gz: f7c079e0b606ee381d58b56a83a9a50f6e5c25e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48f9f9df90f08dcb70d7a507bb9238a3beadfaf5511acd332d0ff573ec80fa2458bf8727ba5fd8e2a031b3602585a810fd78e79830784f0713ddc71948d4ee5f
|
7
|
+
data.tar.gz: 32aa569a4ffc4c0381ccb4328d1c8c2e80e509b63bc81d42a53bdbb8f2e32c5e292431020e51a11abe3aa85a3f3a0578fb1aa0f9adb695eaad1bafa9706e5121
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module ContentfulRails
|
2
|
+
module Sluggable
|
3
|
+
# A quick mixin to slugify a field other than 'slug'
|
4
|
+
# NOTE that if you include sluggable (and define a slug field) in a class which responds to
|
5
|
+
# slug() than you'll get a stack level too deep error.
|
6
|
+
module Sluggable
|
7
|
+
extend ActiveSupport::Concern
|
8
|
+
|
9
|
+
class_methods do
|
10
|
+
attr_accessor :slug_field
|
11
|
+
end
|
12
|
+
|
13
|
+
def slug
|
14
|
+
if self.class.slug_field.present?
|
15
|
+
self.send(self.class.slug_field).parameterize(Rails.configuration.x.param_delimiter)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/contentful_rails.rb
CHANGED
@@ -3,6 +3,7 @@ require "contentful_rails/development_constraint"
|
|
3
3
|
require "contentful_rails/cached_timestamps"
|
4
4
|
require "contentful_rails/markdown_renderer"
|
5
5
|
require "contentful_rails/nested_resource"
|
6
|
+
require "contentful_rails/sluggable"
|
6
7
|
require 'redcarpet'
|
7
8
|
|
8
9
|
module ContentfulRails
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contentful_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Error Creative Studio
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.1.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.1.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- lib/contentful_rails/engine.rb
|
71
71
|
- lib/contentful_rails/markdown_renderer.rb
|
72
72
|
- lib/contentful_rails/nested_resource.rb
|
73
|
+
- lib/contentful_rails/sluggable.rb
|
73
74
|
- lib/contentful_rails/version.rb
|
74
75
|
- lib/tasks/contentful_rails_tasks.rake
|
75
76
|
- test/contentful_rails_test.rb
|