Sha256: cba53017814d859a8061c6cf9e976cd294bc401dd5e23df852560ce39764cbb7

Contents?: true

Size: 316 Bytes

Versions: 45

Compression:

Stored size: 316 Bytes

Contents

# Example from 'Overwriting default accessors' in ActiveRecord::Base.
class Song < ActiveRecord::Base
  has_paper_trail

  # Uses an integer of seconds to hold the length of the song
  def length=(minutes)
    write_attribute(:length, minutes.to_i * 60)
  end
  def length
    read_attribute(:length) / 60
  end
end

Version data entries

45 entries across 45 versions & 3 rubygems

Version Path
paper_trail-3.0.7 test/dummy/app/models/song.rb
paper_trail-4.0.0.beta2 test/dummy/app/models/song.rb
paper_trail-4.0.0.beta1 test/dummy/app/models/song.rb
paper_trail-3.0.6 test/dummy/app/models/song.rb
paper_trail-3.0.5 test/dummy/app/models/song.rb
paper_trail-3.0.2 test/dummy/app/models/song.rb
paper_trail-3.0.1 test/dummy/app/models/song.rb
paper_trail-3.0.0 test/dummy/app/models/song.rb
paper_trail-3.0.0.rc2 test/dummy/app/models/song.rb
paper_trail-3.0.0.rc1 test/dummy/app/models/song.rb
paper_trail_without_deprecated-3.0.0.beta1 test/dummy/app/models/song.rb
paper_trail-3.0.0.beta1 test/dummy/app/models/song.rb
paper_trail-2.7.2 test/dummy/app/models/song.rb
paper_trail-2.7.1 test/dummy/app/models/song.rb
paper_trail-2.7.0 test/dummy/app/models/song.rb
paper_trail-2.6.4 test/dummy/app/models/song.rb
paper_trail-2.6.3 test/dummy/app/models/song.rb
paper_trail-2.6.2 test/dummy/app/models/song.rb
paper_trail-2.6.1 test/dummy/app/models/song.rb
paper_trail-2.6.0 test/dummy/app/models/song.rb