2010-07-16 20:36:07 +00:00
|
|
|
module Models
|
|
|
|
module Extensions
|
|
|
|
module Page
|
|
|
|
module Templatized
|
|
|
|
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
|
|
|
|
|
|
|
belongs_to_related :content_type
|
|
|
|
|
|
|
|
field :templatized, :type => Boolean, :default => false
|
|
|
|
|
|
|
|
field :content_type_visible_column
|
|
|
|
|
2010-07-20 10:15:53 +00:00
|
|
|
before_validation :set_slug_if_templatized
|
2010-07-16 20:36:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
module InstanceMethods
|
|
|
|
|
|
|
|
def set_slug_if_templatized
|
|
|
|
self.slug = 'content_type_template' if self.templatized?
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|