Updating all tests. All tests are passing

This commit is contained in:
Michael Bianco
2012-03-30 19:25:07 -04:00
parent 62082f5a82
commit c4a85b71d7
8 changed files with 13 additions and 8 deletions
+4 -1
View File
@@ -3,7 +3,10 @@ module Spree
belongs_to :digital
belongs_to :line_item
validates_length_of :secret, :is => 30
validates :digital, :presence => true
before_validation :set_defaults, :on => :create
# 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
+2 -1
View File
@@ -1,6 +1,6 @@
Spree::LineItem.class_eval do
has_many :digital_links
has_many :digital_links, :dependent => :destroy
after_save :create_digital_links, :if => :digital?
@@ -14,6 +14,7 @@ Spree::LineItem.class_eval do
# Create the download link for this item if it is digital.
def create_digital_links
digital_links.delete_all
self.quantity.times do
digital_links.create!(:digital => variant.digital)
end