[ALOY-732] Alloy: Model db_name is ignored when db_file is set
|Fix Version/s||Alloy 1.2.0, 2013 Sprint 14|
DescriptionWhen you set both
db_fileto preload an existing SQLite database for a model, the
db_namegets ignored. This is because a typo in the SQLite sync adapter for which I'll do a PR.
Should be:var dbName = config.adapter.db_name = match;
var dbName = config.adapter.db_name || match;
- Fokke Zandbergen 2013-07-02 The PR: https://github.com/appcelerator/alloy/pull/168
- Tony Lukasavage 2013-07-08
Reviewed and merged. Also added a change for testing.
test app: https://github.com/appcelerator/alloy/tree/master/test/apps/models/sql_preload
The existing "models/sql_preload" test app was modified to use both db_name and db_file. If you run it on iOS (from a reset), you'll notice that it lists all the expected fighter names. Additionally, if you navigate to your apps directory, in my case:
You'll see that the database file is named "fighters" instead of "myapp" now.
/Users/tlukasavage/Library/Application Support/iPhone Simulator/6.1/Applications/25822227-C9F2-40C2-82F7-9784F2DDF002/Library/Private Documents
- Federico Casali 2013-07-15 Verified as fixed. Environment: Titanium SDK 3.1.2.v20130710144553 Appcelerator Studio 22.214.171.124307101037 Alloy 1.2.0 Android device 4.2.2 and iOS 5. Closing.