Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/sproutcore-datastore/lib/system/record.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ SC.Record = SC.Object.extend(
refresh: function(recordOnly, callback) {
var store = get(this, 'store'), rec, ro,
sk = get(this, 'storeKey'),
prKey = store.parentStoreKeyExists();
prKey = store.parentStoreKeyExists(sk);

if (!callback && 'function'===typeof recordOnly) {
callback = recordOnly;
Expand All @@ -287,7 +287,7 @@ SC.Record = SC.Object.extend(

// If we only want to refresh this record or it doesn't have a parent
// record we will commit this record
if (recordOnly || (none(recordOnly) && none(prKey))) {
if (recordOnly || none(prKey)) {
store.refreshRecord(null, null, sk, callback);
} else if (prKey) {
rec = store.materializeRecord(prKey);
Expand All @@ -312,11 +312,11 @@ SC.Record = SC.Object.extend(
destroy: function(recordOnly) {
var store = get(this, 'store'), rec, ro,
sk = get(this, 'storeKey'),
prKey = store.parentStoreKeyExists();
prKey = store.parentStoreKeyExists(sk);

// If we only want to destroy this record or it doesn't have a parent
// record we will commit this record
ro = recordOnly || (none(recordOnly) && none(prKey));
ro = recordOnly || none(prKey);
if (ro){
SC.propertyWillChange(this, 'status');
store.destroyRecord(null, null, sk);
Expand Down Expand Up @@ -722,11 +722,11 @@ SC.Record = SC.Object.extend(
commitRecord: function(params, recordOnly, callback) {
var store = get(this, 'store'), rec, ro,
sk = get(this, 'storeKey'),
prKey = store.parentStoreKeyExists();
prKey = store.parentStoreKeyExists(sk);

// If we only want to commit this record or it doesn't have a parent record
// we will commit this record
ro = recordOnly || (SC.none(recordOnly) && SC.none(prKey));
ro = recordOnly || none(prKey);
if (ro){
store.commitRecord(undefined, undefined, get(this, 'storeKey'), params, callback);
} else if (prKey){
Expand Down