Module: Stall::CustomersHelper
- Defined in:
- app/helpers/stall/customers_helper.rb
Instance Method Summary collapse
- #current_stall_user ⇒ Object
- #stall_user_signed_in? ⇒ Boolean
-
#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
#current_stall_user ⇒ Object
7 8 9 |
# File 'app/helpers/stall/customers_helper.rb', line 7 def current_stall_user send(Stall.config.default_user_helper_method) end |
#stall_user_signed_in? ⇒ Boolean
3 4 5 |
# File 'app/helpers/stall/customers_helper.rb', line 3 def stall_user_signed_in? !!current_stall_user end |
#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
14 15 16 17 18 19 20 21 22 23 |
# File 'app/helpers/stall/customers_helper.rb', line 14 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 |