app/models/landable/template.rb in landable-1.11.1 vs app/models/landable/template.rb in landable-1.12.1
- old
+ new
@@ -17,9 +17,11 @@
has_many :audits, class_name: 'Landable::Audit', as: :auditable
has_many :revisions, class_name: 'Landable::TemplateRevision'
has_and_belongs_to_many :pages, join_table: Page.templates_join_table_name
+ delegate :count, to: :pages, prefix: true # Returns how many Pages a Template lives in!
+
before_save -> template {
template.is_publishable = true unless template.published_revision_id_changed?
}
def deactivate