lib/locomotive/wagon/liquid/drops/base.rb in locomotivecms_wagon-1.5.4 vs lib/locomotive/wagon/liquid/drops/base.rb in locomotivecms_wagon-1.5.5
- old
+ new
@@ -10,11 +10,14 @@
def initialize(source)
@_source = source
end
def id
- (@_source.respond_to?(:id) ? @_source.id : nil) || 'new'
+ (@_source.respond_to?(:id) ? @_source.id : nil) ||
+ (@_source.respond_to?(:slug) ? @_source.slug : nil) ||
+ (@_source.respond_to?(:_slug) ? @_source._slug : nil) ||
+ 'new'
end
# converts an array of records to an array of liquid drops
def self.liquify(*records, &block)
i = -1
@@ -41,6 +44,6 @@
end
end
end
end
-end
\ No newline at end of file
+end