public
Description: RESTful Rails Wiki
Clone URL: git://github.com/josh/wiki.git
All find_version to be passed nil for version in ActsAsVersioned plugin.
josh (author)
Sat Mar 01 12:49:09 -0800 2008
commit  806ea1287d54ed9266fb9920924ea4c77626b6b4
tree    cc60fde9c0bbdbfc156672ae458f42120c5cbac6
parent  9c25cd64253b00fffe1bb0c8456d55bbfd1de2b7
...
289
290
291
292
 
293
294
295
...
451
452
453
454
 
 
 
455
456
457
...
289
290
291
 
292
293
294
295
...
451
452
453
 
454
455
456
457
458
459
0
@@ -289,7 +289,7 @@ module ActiveRecord #:nodoc:
0
         end
0
 
0
         # Finds a specific version of this record
0
- def find_version(version)
0
+ def find_version(version = nil)
0
           self.class.find_version(id, version)
0
         end
0
 
0
@@ -451,7 +451,9 @@ module ActiveRecord #:nodoc:
0
 
0
         module ClassMethods
0
           # Finds a specific version of a specific row of this model
0
- def find_version(id, version)
0
+ def find_version(id, version = nil)
0
+ return find(id) unless version
0
+
0
             conditions = ["#{versioned_foreign_key} = ? AND version = ?", id, version]
0
             options = { :conditions => conditions, :limit => 1 }
0
 

Comments

    No one has commented yet.