Reputation: 63
I want to build reports for some database data. I store report's settings in database through activerecord models, but I don't want that, I want to write something like
class Department < ActiveRecord::Base
...
report do
name "Total Sales by Departments"
method :name
report_field do
name "Total Sales"
action :sum
relation "Sales"
method :spent
end
report_field do
name "Average Sales"
action :avg
relation "Sales"
method :spent
end
end
end
Can someone please tell me how this is possible to do and what should I read, maybe some examples of other things that are similar to my problem?
Upvotes: 3
Views: 242