Created
October 1, 2012 01:46
-
-
Save pnegri/3809001 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [feature/criar_conta] patricknegri@~/Desenvolvimento/buzap_app_old/app/models: cat assinatura.rb | |
| class Assinatura < ActiveResource::Base | |
| #self.site = "http://localhost:3001" | |
| self.site = "http://assinaturas.iugu.com.br" | |
| def self.api_key | |
| 'smallandsmart' | |
| end | |
| def self.find(*args) | |
| options = args.last.is_a?(Hash) ? args.pop : {} | |
| #if not options.include? :params | |
| options[:params] = Hash.new if options[:params].nil? | |
| #end | |
| options[:params][:api] = self.api_key | |
| args.push(options) | |
| super | |
| end | |
| def save | |
| prefix_options[:api] = Assinatura.api_key | |
| #self.attributes.delete :id | |
| super | |
| end | |
| def destroy | |
| prefix_options['api'] = Assinatura.api_key | |
| super | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment