lib/nanoc/base/entities/item_rep.rb in nanoc-4.1.0b1 vs lib/nanoc/base/entities/item_rep.rb in nanoc-4.1.0rc1
- old
+ new
@@ -67,10 +67,10 @@
# Get name of last pre-layout snapshot
snapshot_name = snapshot || (@snapshot_contents[:pre] ? :pre : :last)
is_moving = [:pre, :post, :last].include?(snapshot_name)
# Check existance of snapshot
- snapshot_def = snapshot_defs.find { |sd| sd.name == snapshot_name }
+ snapshot_def = snapshot_defs.reverse.find { |sd| sd.name == snapshot_name }
if !is_moving && (snapshot_def.nil? || !snapshot_def.final?)
raise Nanoc::Int::Errors::NoSuchSnapshot.new(self, snapshot_name)
end
# Verify snapshot is usable