2011-10-30 23:02:41 +00:00
|
|
|
module Locomotive
|
|
|
|
module Extensions
|
|
|
|
module Page
|
|
|
|
module Templatized
|
|
|
|
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
|
|
|
|
2011-11-26 06:24:34 +00:00
|
|
|
referenced_in :content_type, :class_name => 'Locomotive::ContentType'
|
2011-10-30 23:02:41 +00:00
|
|
|
|
|
|
|
field :templatized, :type => Boolean, :default => false
|
|
|
|
|
|
|
|
field :content_type_visible_column
|
|
|
|
|
|
|
|
before_validation :set_slug_if_templatized
|
|
|
|
end
|
|
|
|
|
|
|
|
module InstanceMethods
|
|
|
|
|
|
|
|
def set_slug_if_templatized
|
|
|
|
self.slug = 'content_type_template' if self.templatized?
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2011-11-26 06:24:34 +00:00
|
|
|
end
|