strongloop-community / loopback-sdk-ios

iOS Client SDK for the LoopBack framework.
Other
76 stars 39 forks source link

Add support for plain model creation #92

Closed hideya closed 8 years ago

hideya commented 8 years ago

This PR adds a method to create an LBModel object without setting initial parameters via dictionary.

When to create and initialise an object of a subclasses of LBPersistedModel, the following code would be a typical way. However, it is unnecessarily wordy:

Widget *model = (Widget*)[self.repository modelWithDictionary:nil];
model.name = @"Foo";
model.bars = 123;

This PR is to make the initialisation code simply like the following:

Widget *model = (Widget*)[self.repository model];
model.name = @"Foo";
model.bars = 123;
bajtos commented 8 years ago

@hideya LGTM

hideya commented 8 years ago

@bajtos thanks for the prompt review! I'm going to land this!