lib/vestal_versions.rb in laserlemon-vestal_versions-0.4.5 vs lib/vestal_versions.rb in laserlemon-vestal_versions-0.5.0
- old
+ new
@@ -57,12 +57,11 @@
def create_version
if versions.empty?
versions.create(:changes => attributes, :number => 1)
else
- reset_version
- versions.create(:changes => changes, :number => (version.to_i + 1))
+ versions.create(:changes => changes, :number => (last_version + 1))
end
reset_version
end
@@ -110,16 +109,12 @@
revert_to(value)
reset_version if saved = save
saved
end
- def last_changes
+ def latest_changes
return {} if version.nil? || version == 1
versions.at(version).changes
- end
-
- def last_changed
- last_changes.keys
end
end
end
end