Sha256: 2546c2c1050198444c79ac82e70b878bf40aae25e70a6708fbb0bd5bb4e82d3f

Contents?: true

Size: 312 Bytes

Versions: 3

Compression:

Stored size: 312 Bytes

Contents

module EemModel

  class ContentFile < ActiveRecord::Base

    # needs to save percent done to object in db
    def update_progress(dl_total, dl_now)
      done_now = (Float(dl_now) / Float(dl_total) * 100).round
      update_attribute(:percent_done, done_now) if(done_now != percent_done)
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
eem_model-0.9.1 lib/eem_model/content_file.rb
eem_model-0.9.0 lib/eem_model/content_file.rb
eem_model-0.0.3 lib/eem_model/content_file.rb