ruby - require lot and inventory reports of products in rails -
I am helping someone with an existing rail app. I was wondering how to do some special approach though. I need a full report (inventory report) that shows the complete history of a particular parent lottery. Then I want to show results on a report / inventory page. I am using sqlite3 and mysql2 in production in development, but i sure know how to go about this?
How are you entering history? Is it in a related table? In the past, I have created a related "History" table in order to create records and logs updates - it provides a good timing of events for related records, and be told through this connection Meaning:
Model:
# of whose history you are tracking class records & lt; ActiveRecord :: Base has_many: logs end # class, where you log the history log entries category & lt; ActiveRecord :: Base is_to: record expiration Controller:
Class Record Controller & lt; ApplicationController includes RecordFactory ... def if @ record.create_new_record (record_prim) calls to # factory ... Finally def updated if @record.update_existing_record (record_perm) calls the #factory ... and end .. . factory
class recordfinity def create_new_record (record_prim) record.Credit! (Record_perm) Tap | Record | Logs. Create (...) end-of-end update_existing_record (record_param) record.update_atr! (Record_param). Tap | Record | Log in (...) End And End Code to call Relation when displayed:
record = record. Record.logs # logs for records
Comments
Post a Comment