Module: ContentfulRails
- Defined in:
- lib/contentful_rails.rb,
lib/contentful_rails/engine.rb,
lib/contentful_rails/preview.rb,
lib/contentful_rails/version.rb,
lib/contentful_rails/sluggable.rb,
lib/contentful_rails/nested_resource.rb,
lib/contentful_rails/markdown_renderer.rb,
lib/contentful_rails/caching/timestamps.rb,
lib/contentful_rails/development_constraint.rb,
app/helpers/contentful_rails/markdown_helper.rb,
app/controllers/contentful_rails/webhooks_controller.rb
Overview
A collection of useful things to help make it easier to integrate Contentful into your Rails app. It includes view helpers, a Webhook handler, caching, and a Rails Engine to hook it all together.
Defined Under Namespace
Modules: Caching, MarkdownHelper, NestedResource, Preview, Sluggable Classes: Configuration, DevelopmentConstraint, Engine, MarkdownRenderer, WebhooksController
Constant Summary collapse
- VERSION =
Version number
'0.5.0'.freeze
Class Attribute Summary collapse
-
.configuration ⇒ Object
Returns the value of attribute configuration.
Class Method Summary collapse
- .active_record_available? ⇒ Boolean
- .configure {|configuration| ... } ⇒ Object
- .include_migrations_to_active_record ⇒ Object
Class Attribute Details
.configuration ⇒ Object
Returns the value of attribute configuration.
16 17 18 |
# File 'lib/contentful_rails.rb', line 16 def configuration @configuration end |
Class Method Details
.active_record_available? ⇒ Boolean
30 31 32 33 34 |
# File 'lib/contentful_rails.rb', line 30 def self.active_record_available? Module.const_get('ActiveRecord::Migration') rescue NameError false end |
.configure {|configuration| ... } ⇒ Object
19 20 21 22 |
# File 'lib/contentful_rails.rb', line 19 def self.configure self.configuration ||= Configuration.new yield(configuration) end |
.include_migrations_to_active_record ⇒ Object
24 25 26 27 28 |
# File 'lib/contentful_rails.rb', line 24 def self.include_migrations_to_active_record return unless active_record_available? ActiveRecord::Migration.send(:include, ContentfulModel::Migrations::Migration) end |