Added preferences for click amount and valid days on digital links. Tests for authorization are now running

This commit is contained in:
Michael Bianco
2012-03-31 11:07:52 -04:00
parent c4a85b71d7
commit e652835a5f
4 changed files with 45 additions and 57 deletions

View File

@@ -11,7 +11,7 @@ module Spree
# Can this link stil be used? It is valid if it's less than 24 hours old and was not accessed more than 3 times
def authorizable?
self.created_at > 1.day.ago and self.access_counter < 3
self.created_at > Spree::DigitalConfiguration[:authorized_days].day.ago and self.access_counter < Spree::DigitalConfiguration[:authorized_clicks]
end
# This method should be called when a download is initiated.