Class: ActiveRecord::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/base/data_type_for_manifest.rb

Direct Known Subclasses

ContentBlock, Editor, Page

Class Method Summary collapse

Class Method Details

.data_type_for_manifestObject

Adds this instance of ActiveRecord::Base to Manifest.configuration.data_types.



3
4
5
6
7
8
9
10
11
# File 'lib/active_record/base/data_type_for_manifest.rb', line 3

def self.data_type_for_manifest
  nav_name = ActiveSupport::Inflector.pluralize(self.to_s)
  route = "manifest_#{nav_name.underscore}_path"

  Manifest.configure do |config|
    config.data_types << { nav_name: ActiveSupport::Inflector.pluralize(self.to_s), route: route }
    config.data_types.uniq!
  end
end