Add `arrived` attribute (file creation timestamp) to books table.
[quanlib.git] / book.rb
diff --git a/book.rb b/book.rb
index ea650249a9ac6c8c120e72824dce646276bc4c9f..2b93f4b574c9c45738a3a95a2c0b4f1697083d1c 100644 (file)
--- a/book.rb
+++ b/book.rb
@@ -12,6 +12,7 @@ class Book
   @@DC_NS_URL = 'http://purl.org/dc/elements/1.1/'
   @@SERIES_AND_VOLUME_REGEX = /^([A-Z]+)([0-9]+(\.[0-9]+)?)$/
 
+  attr_accessor :arrived
   attr_accessor :author
   attr_accessor :classification_id
   attr_accessor :cover
@@ -224,6 +225,8 @@ class Book
       scan_pdf!(file_name)
     end
 
+    @arrived = File.ctime(file_name)
+
     @classification_id = @store.find_classification(@author.grouping, File.basename(file_name, '.*'))
 
     # TODO:  Fix horrible hard-coded strings and paths