lib/express_templates/components/capabilities/resourceful.rb in express_templates-0.7.0 vs lib/express_templates/components/capabilities/resourceful.rb in express_templates-0.7.1
- old
+ new
@@ -95,10 +95,18 @@
def collection_var
"@#{collection_name}".to_sym
end
def collection
- config[:collection] || helpers.collection
+ if config[:collection]
+ if config[:collection].respond_to?(:call)
+ config[:collection].call()
+ else
+ config[:collection]
+ end
+ else
+ helpers.collection
+ end
end
def collection_path
if config[:collection_path]
config[:collection_path]