Jason Vogel
2007-Jan-27 07:39 UTC
Interchanging ActiveRecord and ActionWebService... Help with my problem and suggestions for Best Practices.
Okay, I''m try to support two situations "easily". I need to be able to use either ActiveRecord or ActionWebService. So I''m trying to handle this "switch" as transparently as possible. I''m totally open to suggestions.. Thanks, Jason I''m getting the following error: NoMethodError in Offer renewalController#payment_made undefined method `make_payment'' for WebservicePaymentApi:Class Source: class WebservicePaymentApi < ActionWebService::API::Base require ''contract_payment'' api_method :make_credit_card_payment, :expects => [{:contract_id => :int}, {:amount => :float}, {:card_type => :string}, {:card_number => :string}, {:card_verification_code => :string}, {:card_expiration_date => :date} ], :returns => [:string] def make_payment(contract_payment) puts contract_payment.inspect end end class TestController < ApplicationController def handle_payment if (@contract_payment.valid?) # ActiveRecord - Works! # @contract_payment.save # WebService # webservice_payment_api = WebservicePaymentApi.new WebservicePaymentApi.make_payment(@contract_payment) end end # handle_payment --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Reasonably Related Threads
- Link to remote and the equivalent in Rails 3
- [GSoC 2016] [Polly] Implementation of tiling, interchanging and unrolling of specific loops based on the algorithm for the analytical modeling
- [GSoC 2016] [Polly] Implementation of tiling, interchanging and unrolling of specific loops based on the algorithm for the analytical modeling