A key feature of Track Magic is the ability to modify data locally and then upload the changes back to the Rails table. Data can be edited one cell at a time (see Working With the Data Sheet) or en masse (see Bulk Data Changes). Either way, Track Magic keeps track of what has been changed. Only data that has actually changed will be sent back to Rails.
Track Magic can be configured to send changes to Rails immediately (see the next section), but normally it saves up the changes until you choose the Upload All Changes to Rails command from the Rails menu.
This command gathers all of the modified table and submits the changes to Rails (thru ActiveRecord). When this is complete it will report the number of changes that were made to the Rails table.
Upload Synchronization Modes
Track Magic has three synchronization modes for uploading data: Immediate, Manual and Off. Use the Local Database Options dialog to choose which mode is active (the default is Manual).
In Immediate mode Track Magic will immediately upload any changes made to the Rails server. The disadvantage of this mode is that there will be a delay as you edit each cell.
In Manual mode (the default) Track Magic will save the changes you make until you choose the Upload All Changes to Rails command from the Rails menu (see the previous section).
In Off mode Track Magic will not upload changes at all, and in fact will not even keep track of changes. Use this mode if you want to be able to make scratch changes to the local Panorama database and want to make sure that the Rails table will not be modified.
Track Magic and ActiveRecord Data Validation
Since Track Magic uses ActiveRecord to access the Rails table, any validation rules you've added to your Rails model will be applied. In other words, it's possible that changes you've made to the local Panorama database won't be accepted in the Rails table. If this happens Track Magic will notifiy you of the problem. (This image shows a Growl notification, but if you don't have Growl installed (see Growl Support) you'll see a regular modal alert.)
Now you know there is a problem, but what exactly is the problem, and what data is affected? The exact problems are listed in the __Exception field, as shown above.
You can also display the problems in a particular record by using theValidation Errors (Current Record) command in the Rails menu.
Correct whatever problems are listed and choose Upload All Changes to Rails from the Rails menu to re-submit the changes.
Disabling Validation
If you want to bypass the validation rules set up for this table (see Data Validation), open the Local Database Options dialog (in the Rails menu) and check the Bypass Rails Validation option.
When this option is checked you can enter any value into any field in this table. Be careful! (Note: This option only affects data modified in Panorama. Your Rails application will still validate data normally, whether this option is on or off.)
Specifying What Local Data Will Be Displayed after Uploading Data
The Local Database Options… dialog in the Rails menu allows you to specify what data is displayed after data is uploaded.
If Synchronized Records is chosen, any record that contained modified data that was uploaded will be selected (visible). Non-modified records will be temporarily invisible.
If All Records is chosen, all records in the local copy of the database will be visible after the upload.
If Original Selection is chosen, whatever records were visible before the upload will remain visible after the upload.
No matter which option is chosen you can always make all records visible at any time by choosing Select All from the Search menu. You can also use this menu to make other selections from local data (see Find and Select).
Uploading The Current Record
The Upload Current Record (Changes Only) command in the Rails menu is identical to the Upload All Changes to Rails command, except for the fact that it only uploads changes from the current record, not the entire database. If you've only made changes to the current record this command will be slightly faster than the Upload All Changes command.
Uploading an Entire Database
Sometimes you may want to start over and upload an entire Panorama database to Rails. Use the Upload All Local Data to Rails command in the Rails menu to do this. This command erases all the data in the Rails table, then uploads the entire contents of the local Panorama database to the Rails table. In other words, this command completely replaces the contents of the Rails table with the contents of the local Panorama database. Obviously you'll want to use caution with this command. Since this is such a drastic move, Track Magic will ask you to confirm before it performs this operation.