Displaying 4 results from an estimated 4 matches for "paymentmethods".
Did you mean:
paymentmethod
2011 Nov 02
2
Specify and validate requirements on an ActiveRecord association
...ts`. When I (a `User`) want to assign
accounts to a `PaymentMethod`, I really don''t want to scope against
all of them, but rather only those that I own. While this can be done
at the controller level, it feels like a data-level constraint.
I will want a validation, to ensure I do not map `PaymentMethods` to
`Accounts` with different `Users`. But I will also want a way to
specify the scope of possible associations, effectively using the same
logic as the validation. Placing conditions on the association doesn''t
restrict invalid associations, nor does it imply that.
A useful syntax might b...
2009 Feb 26
1
Problem w/ActionWebService and Inheritance in Service Params
I have a service method that takes a PaymentMethod which can either be a
CreditCard or a PayPal account. When I request the service and pass one
or the other it always comes over as a PaymentMethod; the service
doesn''t seem to know that the parameter is really a CreditCard or
PayPal. Here''s some sample code that illustrates what I''m talking about
more concretely:
2008 Jul 16
2
belongs_to causing endless loop on first call to save!
Hi,
I have a situation I''m hoping someone out there may be able to shed some
light on. I have a Rails app (2.1.0 on Ruby 1.8.7) with a wizard-based sign
up process, that has recently been changed from storing incremental data in
the database to having a medium sized object graph living in the user
session until the user completes the entire sign up process (this is a
business
2009 Mar 10
0
autosave no longer a valid option for belongs_to?
...practice for persisting your child objects when saving a parent object?
Here''s an example:
class PaymentMethod < ActiveRecord::Base
belongs_to :billing_address, :class_name => "Address"
end
class Address < ActiveRecord::Base
validates_presence_of :line_one
end
class PaymentMethodsController < ActionController::Base
def update
@pm = PaymentMethod.find(params[:id])
@pm.billing_address.line_one = params[:billing_address][:line_one]
# ...
if @pm.save
# ...
end
end
end
Thanks in advance.
Jason
--
Posted via http://www.ruby-forum.com/.
--~--~--...