Skip to content

Commit

Permalink
version will display latest to first
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthikeyan A K committed Dec 14, 2014
1 parent 089765c commit e7d3f28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/finance_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class FinanceRecord < ActiveRecord::Base
has_many :docs
has_many :notes
before_create :assign_sno
belongs_to :whodidit, class_name: "User", foreign_key: :whodunnit_id
belongs_to :whodidit, class_name: "User", foreign_key: :whodunnit_id

has_paper_trail # as dictated by paper_trail gem

Expand Down Expand Up @@ -36,7 +36,7 @@ def transaction
# Returns all versions of this finance record
def history
finance_records = []
for version in self.versions
for version in self.versions.reverse
finance_records << self.version_at(version.created_at)
end
finance_records
Expand Down

0 comments on commit e7d3f28

Please sign in to comment.