Use model.save() for saving records
Also, there is no need to use transactions anymore
This commit is contained in:
parent
823c8441be
commit
670f38542a
|
@ -25,9 +25,5 @@ require 'travis/model'
|
|||
|
||||
toggle: ->
|
||||
return if @get('isSaving')
|
||||
transaction = @get('store').transaction()
|
||||
transaction.add this
|
||||
|
||||
@set 'active', !@get('active')
|
||||
|
||||
transaction.commit()
|
||||
@save()
|
||||
|
|
|
@ -27,10 +27,6 @@ require 'travis/model'
|
|||
Ember.run.next this, ->
|
||||
@poll() if @get('isSyncing')
|
||||
|
||||
Ember.run.next this, ->
|
||||
transaction = @get('store').transaction()
|
||||
transaction.add this
|
||||
|
||||
urlGithub: (->
|
||||
"https://github.com/#{@get('login')}"
|
||||
).property()
|
||||
|
@ -43,18 +39,7 @@ require 'travis/model'
|
|||
).property()
|
||||
|
||||
updateLocale: (locale) ->
|
||||
|
||||
transaction = @get('transaction')
|
||||
transaction.commit()
|
||||
|
||||
self = this
|
||||
observer = ->
|
||||
unless self.get('isSaving')
|
||||
self.removeObserver 'isSaving', observer
|
||||
transaction = self.get('store').transaction()
|
||||
transaction.add self
|
||||
|
||||
@addObserver 'isSaving', observer
|
||||
@save()
|
||||
Travis.setLocale(locale)
|
||||
|
||||
type: (->
|
||||
|
|
Loading…
Reference in New Issue
Block a user