app/models/effective/region.rb in effective_regions-1.4.10 vs app/models/effective/region.rb in effective_regions-1.4.11
- old
+ new
@@ -21,14 +21,15 @@
end
# Hash of the Snippets objectified
#
# Returns a Hash of {'snippet_1' => CurrentUserInfo.new(snippets[:key]['options'])}
- def snippet_objects
+ def snippet_objects(locals = {})
+ locals = {} unless locals.kind_of?(Hash)
@snippet_objects ||= snippets.map do |key, snippet| # Key here is 'snippet_1'
if snippet['class_name']
klass = "Effective::Snippets::#{snippet['class_name'].classify}".safe_constantize
- klass.new(snippet.merge!(:region => self, :id => key)) if klass
+ klass.new(snippet.merge!(locals).merge!(:region => self, :id => key)) if klass
end
end.compact
end
def global?