Sha256: 71f185d07908bb62362ab47ba8a0f2b3e1b95973188a5bc758d44204e27a82a2

Contents?: true

Size: 1.05 KB

Versions: 8

Compression:

Stored size: 1.05 KB

Contents

require 'active_support/core_ext/module/delegation'
require 'active_support/core_ext/module/attribute_accessors'
require 'active_support/hash_with_indifferent_access'

module Cmor
  module Blog
    module Configuration
      def configure
        yield self
      end

      mattr_accessor(:base_controller) do
        '::FrontendController'
      end

      mattr_accessor(:creator_class_name) do
        'User'
      end

      mattr_accessor(:user_factory_name) do
        :user
      end

      mattr_accessor(:posts_index_page_title_proc) do
        ->(view) { view.resource_class.model_name.human(count: :other) }
      end

      mattr_accessor(:pagination_options_proc) do
        ->(view) { { theme: 'twitter-bootstrap-4', pagination_class: 'justify-content-center' } }
      end
      mattr_accessor(:preview_picture_asset_variant_options) do
        { combine_options: { resize: "320x240^", extent: "384x216", gravity: "center" } }
      end

      mattr_accessor(:creator_label_for_post_proc) do
        -> (post) { post.creator&.to_s }
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cmor_blog-0.0.54.pre lib/cmor/blog/configuration.rb
cmor_blog-0.0.53.pre lib/cmor/blog/configuration.rb
cmor_blog-0.0.52.pre lib/cmor/blog/configuration.rb
cmor_blog-0.0.51.pre lib/cmor/blog/configuration.rb
cmor_blog-0.0.50.pre lib/cmor/blog/configuration.rb
cmor_blog-0.0.49.pre lib/cmor/blog/configuration.rb
cmor_blog-0.0.48.pre lib/cmor/blog/configuration.rb
cmor_blog-0.0.45.pre lib/cmor/blog/configuration.rb