Sha256: 4654b4f5368b31edb3ed85eac7d799b22b0f21e9a35f1aaf42621f92d05704ed

Contents?: true

Size: 549 Bytes

Versions: 10

Compression:

Stored size: 549 Bytes

Contents

class window.app.BaseResource extends Backbone.Model
  virtual_attributes: []

  sync: (method, model, options) ->
    @configureAjax()
    Backbone.sync method, model, options

  toJSON: (options) ->
    _.omit( _.clone( @attributes ), @virtual_attributes )

  url: ->
    base = super
    base = @appendLocaleInfo(base)

  configureAjax: ->
    app.ajaxSetup
      headers:
        Authorization: $.base64.encode api_token

  appendLocaleInfo: (uri) ->
    uri + (if uri.indexOf('?') then '?' else '&') + 'hl=' + encodeURIComponent( i18n.locale )

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
iugu-ux-0.9.5 vendor/assets/javascripts/iugu-ux/components/base_resource.js.coffee
iugu-ux-0.9.4 vendor/assets/javascripts/iugu-ux/components/base_resource.js.coffee
iugu-ux-0.9.3 vendor/assets/javascripts/iugu-ux/components/base_resource.js.coffee
iugu-ux-0.9.2 vendor/assets/javascripts/iugu-ux/components/base_resource.js.coffee
iugu-ux-0.9.1 vendor/assets/javascripts/iugu-ux/components/base_resource.js.coffee
iugu-ux-0.9.0 vendor/assets/javascripts/iugu-ux/components/base_resource.js.coffee
iugu-ux-0.8.9 vendor/assets/javascripts/iugu-ux/components/base_resource.js.coffee
iugu-ux-0.8.8 vendor/assets/javascripts/iugu-ux/components/base_resource.js.coffee
iugu-ux-0.8.7 vendor/assets/javascripts/iugu-ux/components/base_resource.js.coffee
iugu-ux-0.8.6 vendor/assets/javascripts/iugu-ux/components/base_resource.js.coffee