Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to map data between iOS application and Rails webservice with backend legacy SQL database
    primarykey
    data
    text
    <p>I am using a Rails webservice to mediate between an iOS app and a legacy SQL Server database.</p> <p>Using Active Record and a slew of ruby gems I have managed to generate a set of models which map directly to the SQL database.</p> <p>However, the objects in my application depend not on any single one of the aforementioned models, but consist of data represented by several models at once (the SQL tables utilize foreign keys).</p> <p>The question is: what is the best way to map (into Core Data) between my app and the ruby models?</p> <p>I was thinking it would make sense to generate 'intermediate' models which correspond directly to my app's objects, and which consist of many 'belongs_to' statements to these existing models. Is this the purpose of belongs_to? Is there a better way? Am I even understanding the capabilities of Rails or am I making things too simplistic or complex?</p> <p>Thanks in advance!!</p> <p>EDIT: For example,</p> <p>I have a Core Data Entity 'Game Instance' which consists of the following attributes:<br/> - name<br/> - denom<br/> - lines<br/> - credits<br/> - reels<br/> - type<br/> - sectionCode<br/> - positionCode<br/></p> <p>The pertinent SQL tables / Rails models are as follows:</p> <p>'GameInstance'<br/> - GameID (FK)<br/> - LocationID (FK)<br/></p> <p>'GameConfiguration'<br/> - GameID<br/> - MachineID (FK)<br/> - DenomID (FK)<br/> - Lines<br/> - Credits<br/> - Reels<br/></p> <p>'Game'<br/> - MachineID<br/> - Type<br/> - Name<br/></p> <p>'Denom'<br/> - DenomID<br/> - DenomValue<br/></p> <p>'Location'<br/> - LocationID<br/> - SectionID (FK)<br/> - PositionID (FK)<br/></p> <p>'Section'<br/> - SectionID<br/> - SectionCode<br/></p> <p>'Position'<br/> - PositionID<br/> - PositionCode<br/></p> <p>As you can see, this single Core Data entity would be dependent on several of the Ruby models.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload