Skip to content

Commit cd608ce

Browse files
committed
Solution to MissingAttributeError 500
1 parent b77903a commit cd608ce

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

app/models/custom_timesheet.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Mantiene l'insieme dei risultati applicando il group by a mano a mano che
22
# vengono aggiunti
33
class Grouer
4-
attr_reader :time_entries
4+
attr_reader :time_entries
55

66
def initialize(campi_gby)
77
@campi = campi_gby
@@ -18,7 +18,9 @@ def add_time_entry(entry)
1818
raise "TimeEntry \"#{entry.inspect}\" non valida" if entry.nil?
1919

2020
entry.class.class_eval do
21-
attr_accessor :attributes
21+
def attributes
22+
@attributes
23+
end
2224
end
2325

2426
# da attributes estraggo uno hash con le sole chiavi di @campi
@@ -65,7 +67,7 @@ def checks
6567
end
6668

6769
class CustomTimesheet
68-
# Campi da visualizzare
70+
# Campi da visualizzare
6971
attr_accessor :selected_fields
7072

7173
# Filtri
@@ -180,6 +182,8 @@ def retrieve_time_entries(fields, sort)
180182
results.each { |t| g.add_time_entry t }
181183
@time_entries = g.time_entries
182184

185+
#@time_entries = results
186+
183187
calculate_total_time
184188
end
185189

0 commit comments

Comments
 (0)