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-2.5.2 test/dummy/app/models/song.rb
paper_trail-2.5.0 test/dummy/app/models/song.rb
paper_trail-2.4.1 test/dummy/app/models/song.rb
paper_trail-2.4.0 test/dummy/app/models/song.rb
bkwld-paper_trail-2.3.3 test/dummy/app/models/song.rb
paper_trail-2.3.3 test/dummy/app/models/song.rb
bkwld-paper_trail-2.3.2 test/dummy/app/models/song.rb
paper_trail-2.3.2 test/dummy/app/models/song.rb
paper_trail-2.3.1 test/dummy/app/models/song.rb
paper_trail-2.3.0 test/dummy/app/models/song.rb
paper_trail-2.2.9 test/dummy/app/models/song.rb
paper_trail-2.2.8 test/dummy/app/models/song.rb
paper_trail-2.2.7 test/dummy/app/models/song.rb
paper_trail-2.2.6 test/dummy/app/models/song.rb
paper_trail-2.2.5 test/dummy/app/models/song.rb
paper_trail-2.2.4 test/dummy/app/models/song.rb
paper_trail-2.2.3 test/dummy/app/models/song.rb
paper_trail-2.2.2 test/dummy/app/models/song.rb
paper_trail-2.2.1 test/dummy/app/models/song.rb
paper_trail-2.2.0 test/dummy/app/models/song.rb