contentful_rails 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4b2f71d5c5edbf6d9ae97162046165ce9b2070e
4
- data.tar.gz: ca52e20c5d70341706caa5ed389043b3be1a2994
3
+ metadata.gz: 9952955574499fc5fd15c613dc0650c2d68d6be4
4
+ data.tar.gz: f7c079e0b606ee381d58b56a83a9a50f6e5c25e4
5
5
  SHA512:
6
- metadata.gz: 0d7dd059d4d2a1302a623756481247b7e1cca58f3c6bb78129d4b63c013e61846d0a21624e9b8096333383062494632950959db6ac623808eec630ecc9520ee6
7
- data.tar.gz: 2eda21fd407da739feba79a8df08e04a89c7d78d3edd68e4075ac35b71819d7a0614021198b34fecbe75a2cc652431897a299a52054f6a3d4babb79bd36d0bb9
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
@@ -1,3 +1,3 @@
1
1
  module ContentfulRails
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -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.8
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.0.6
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.0.6
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