Module: Stall::CustomersHelper
- Defined in:
- app/helpers/stall/customers_helper.rb
Instance Method Summary collapse
-
#with_errors_from_user(customer) ⇒ Object
Copy e-mail error messages from user to customer, allowing them to be displayed in customer e-mail input to the visitor.
Instance Method Details
#with_errors_from_user(customer) ⇒ Object
Copy e-mail error messages from user to customer, allowing them to be displayed in customer e-mail input to the visitor
6 7 8 9 10 11 12 13 14 15 |
# File 'app/helpers/stall/customers_helper.rb', line 6 def with_errors_from_user(customer) return customer unless (user = customer.user) && user.errors.any? return unless ( = user.errors.[:email]) && .any? .each do || customer.errors.add(:email, ) end customer end |