I am working on the analytics page for a rails application. On the analytics page, no data is saved (this is very primitive at the moment), but it uses metrics that I grab from the database (via aggregated expressions built into ActiveRecord). In addition to collecting and presenting indicators, the only other requirement that I have is to give the user the ability to specify a date range for filtering data. Until now, I have used instance variables, etc. To store information about metrics ... as the number of indicators grows, along with the need to manage the start and end dates of filtering. I am starting to think that I should put this data in my own model. If I translate all my βdataβ into a model, should I just use a simple object with attr_accessors or is there a more suitable base class that I could use for mutable data? I am familiar enough with MVC architecture to know that my controller is getting bloated, but not familiar enough with rails to determine how I should organize my data / logic in this case.
Any understanding would be greatly appreciated!
toddk source share