-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Reports without DB table #722
Comments
ActiveScaffold is designed to work with ActiveRecord models, and has some support for Mongoid models too. However, some support was added to display data coming from other sources, which works creating a model which inherit from ActiveScaffold::Tableless, so it acts as ActiveRecord, you have to write the methods to find data or create data, depending on the actions you need to support. I'm not sure what kind of data you are truncating and storing in a table, but you could give a try. I didn't wrote a doc, although there is a model in test directory: Someone added another way to the wiki: https://github.com/activescaffold/active_scaffold/wiki/Using-Active-Scaffold-On-A-Data-Structure-%E2%80%93-No-Database-Table |
I updated my model with new code using Tableless. Now getting error: ActionView::Template::Error (self.execute_simple_calculation must be implemented in a Tableless model to support sum text_field2 columns):
Model
Controller:
|
The error is saying you have to define self.execute_simple_calculation in Report model, as ActiveScaffold is trying to calculate counts, as you set calculate on some columns. |
The absence of data structures like result objects and arrays impedes robust reporting, hampering agile development practices. Implementing these structures would significantly improve data organization and accessibility, leading to enhanced reporting functionalities and streamlined decision-making |
Sorry, I don't know what you mean or trying to achieve. ActiveScaffold is focused in Rails and ActiveRecord, which is default ORM for rails. If you want to use ActiveScaffold to list or create data which is not in a ActiveRecord model, it won't be easy. I have used Tableless to list some data, e.g. got from api or got from files, but it's just a basic ActiveRecord class where you have to define methods to return data so ActiveScaffold can list them. If it's too hard, you can always use ActiveScaffold in other controllers, and build your own code for the reports. |
ActiveScaffold necessitates a table for all reports. Although we currently truncate and store data in a table before accessing it on each request, I acknowledge that this approach leads to data conflicts during simultaneous requests. Unfortunately, I haven't found an alternative yet. Please advise on how to develop reports without relying on a table.
The text was updated successfully, but these errors were encountered: