Skip to content

Commit

Permalink
fix account class
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabina Hofmann committed Dec 18, 2023
1 parent dd59e70 commit 2f3aeab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions application/lib/homebank/csv_convertor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ def initialize(**options)
def generate
return unless @csv_filename

touch_csv
File.mtime(@csv_filename) > timestamp
touch_csv && check_timestamp
end

private

def timestamp
def check_timestamp
@csv_filename && File.exist?(@csv_filename) ? File.mtime(@csv_filename) : Time.now
end

Expand Down
6 changes: 3 additions & 3 deletions application/models/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class Account

attr_accessor(*PROPERTIES)

# %w[date tag memo amount category payee start_line].each do |field|
# define_method("#{field}_csv") { send(field) - 1 }
# end
%w[date tag memo amount category payee start_line].each do |field|
define_method("#{field}_csv") { send(field) - 1 }
end

def initialize(**options)
if options[:user_data_path]
Expand Down

0 comments on commit 2f3aeab

Please sign in to comment.