Added preferences for click amount and valid days on digital links. Tests for authorization are now running
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user