I have a form that is used to generate a report. In this form I have a number of flags set - that will then dictate what my report does.
These variables are then passed to the model and I pick them up
attr_accessor :make_charge
At this point I know I have the variable as I can log it.
I then pass off to the generatereport
file.
This file picks up
attr_accessor :member
attr_reader :make_charge
The report is generated - and the various properties the member has are ok, but I cannot access the value of make charge.
How how do I set a value in one file and then access in another? It would seem to me the attr_accessor
and attr_reader
do this - but I seem to be doing it wrong. (Which we have all agreed on)
The report is generated just fine - what I want to do is a new action on the records of this report - based on a setting in the original form submission. I was hoping to do it in one process - to set the parameters - have the report run and then the records adjusted. The flag is not part of the model. it's a flag if set do something once report is complete.
The report generator is
MemberAccountsByStatusAndDateReportGenerator.new(
Member.
includes(:balances).
joins(:balances).
where{with_balances}.
where(status: report_options[:status]).
where{last_login_at >= start_date }.
where{last_login_at <= end_date}
).to_csv_file(file_name, linesep: "\r\n", colsep: ",")
once the report is run I want to be able to do something to the records based on a different report_option [:variable] But I need to get that variable to the action that creates the file.