From adbae00457c9c7a685330a23e20e1170577d3433 Mon Sep 17 00:00:00 2001 From: Dirk Kelly Date: Wed, 2 Mar 2011 09:13:45 +0800 Subject: [PATCH] changed the editable inheritance tag to be assignable, avoiding confusion between that and the content tag inheritance --- app/models/editable_element.rb | 2 +- app/models/extensions/page/editable_elements.rb | 2 +- lib/locomotive/liquid/tags/editable/base.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/editable_element.rb b/app/models/editable_element.rb index 0ba60c27..10321173 100644 --- a/app/models/editable_element.rb +++ b/app/models/editable_element.rb @@ -8,7 +8,7 @@ class EditableElement field :default_content field :hint field :disabled, :type => Boolean, :default => false - field :inheritable, :type => Boolean, :default => true + field :assignable, :type => Boolean, :default => true field :from_parent, :type => Boolean, :default => false ## associations ## diff --git a/app/models/extensions/page/editable_elements.rb b/app/models/extensions/page/editable_elements.rb index 0716f62c..1246d3af 100644 --- a/app/models/extensions/page/editable_elements.rb +++ b/app/models/extensions/page/editable_elements.rb @@ -62,7 +62,7 @@ module Models def merge_editable_elements_from_page(source) source.editable_elements.each do |el| - next if el.disabled? or !el.inheritable? + next if el.disabled? or !el.assignable? existing_el = self.find_editable_element(el.block, el.slug) diff --git a/lib/locomotive/liquid/tags/editable/base.rb b/lib/locomotive/liquid/tags/editable/base.rb index e359e02f..c1bc1b4c 100644 --- a/lib/locomotive/liquid/tags/editable/base.rb +++ b/lib/locomotive/liquid/tags/editable/base.rb @@ -9,7 +9,7 @@ module Locomotive def initialize(tag_name, markup, tokens, context) if markup =~ Syntax @slug = $1.gsub('\'', '') - @options = { :inheritable => true } + @options = { :assignable => true } markup.scan(::Liquid::TagAttributes) { |key, value| @options[key.to_sym] = value.gsub(/^'/, '').gsub(/'$/, '') } else raise ::Liquid::SyntaxError.new("Syntax Error in 'editable_xxx' - Valid syntax: editable_xxx (, )") @@ -27,7 +27,7 @@ module Locomotive :slug => @slug, :hint => @options[:hint], :default_content => @nodelist.first.to_s, - :inheritable => @options[:inheritable], + :assignable => @options[:assignable], :disabled => false, :from_parent => false }, document_type)