Sha256: 6010caec9916ad51a302c69328e9519dbcf2a2f8fa71e3f13f190e41c1d9d702

Contents?: true

Size: 160 Bytes

Versions: 47

Compression:

Stored size: 160 Bytes

Contents

class Invoice < ActiveRecord::Base
  has_many :line_items, :autosave => true
  before_save {|record| record.balance = record.line_items.map(&:amount).sum }
end

Version data entries

47 entries across 47 versions & 8 rubygems

Version Path
ibm_db-5.2.0 test/models/invoice.rb
ibm_db-5.1.0 test/models/invoice.rb
ibm_db-5.0.5 test/models/invoice.rb
ibm_db-5.0.4 test/models/invoice.rb
ibm_db-5.0.3 test/models/invoice.rb
ibm_db-5.0.2 test/models/invoice.rb
ibm_db-4.0.0-x86-mingw32 test/models/invoice.rb
ibm_db-4.0.0 test/models/invoice.rb
ibm_db-3.0.4-x86-mingw32 test/models/invoice.rb
ibm_db-3.0.4 test/models/invoice.rb
ibm_db-3.0.3-x86-mingw32 test/models/invoice.rb
ibm_db-3.0.3 test/models/invoice.rb
ibm_db-3.0.2-x86-mingw32 test/models/invoice.rb
ibm_db-3.0.2 test/models/invoice.rb
activejob-lock-0.0.2 rails/activerecord/test/models/invoice.rb
ibm_db-3.0.1 test/models/invoice.rb
ibm_db-3.0.1-x86-mingw32 test/models/invoice.rb
activejob-lock-0.0.1 rails/activerecord/test/models/invoice.rb
activerecord-nuodb-adapter-2.0.3 test/models/invoice.rb
activerecord-nuodb-adapter-2.0 test/models/invoice.rb