Fix a before_filter preventing to save a content instance with a

custom field `active' or `visible' set to false.
Fixes #272.
This commit is contained in:
Pietro Giorgianni 2012-01-12 16:18:55 +01:00
parent a650acd535
commit 99d889f6e2

View File

@ -104,6 +104,7 @@ class ContentInstance
def set_visibility def set_visibility
field = self.content_type.content_custom_fields.detect { |f| %w{visible active}.include?(f._alias) } field = self.content_type.content_custom_fields.detect { |f| %w{visible active}.include?(f._alias) }
self._visible = self.send(field._name) rescue true self._visible = self.send(field._name) rescue true
true
end end
def add_to_list_bottom def add_to_list_bottom