This plugin creates objective c models from the routes declared in routes.rb for use with ObjectiveResouce
rake objective_resource:generate
If you have a routes.rb file that contains the following
map.resources :people do |person|
person.resources :dogs
end
The plugin will create 3 class files
The file ObjectiveResourceSetup contains settings for the framework (url , user info , etc)
The model files discovered from the routes above. The attributes found in the columns_hash will be converted to objective c types. Also , the nested routes for dogs will be generated
The Person model will also have
-(NSArray *)findAllDogs;
which will get all the person’s dogs
If you have a routes.rb file that contains the following
map.resources :people do |person|
person.resources :dogs , {:member=>{:pet => [:post]},:collection =>{ :search => [:any]}}
end
The plugin will generate the same files as above but will also generate the following stubs with most likely incomplete boilerplate code.
- (BOOL)postPetWithError:(NSError **)error;
- (id)getSearchWithError:(NSError **)error;
- (BOOL)postSearchWithError:(NSError **)error;
- Models that are nested in multiple models are not created correctly
- tests
Copyright © 2009 James Burka, released under the MIT license