Guest User

Untitled

a guest
Feb 24th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. # Required for anonymous struct of cross_sell products.
  2. require 'disposable/twin/struct' # Disposible version 0.4.3.
  3.  
  4. # Contract for validating input for sending an auto email.
  5. class Email::ThankYou::Auto::Contract < Reform::Form # Reform version: 2.2.4
  6. # Included for cross_sell to construct itself.
  7. include Disposable::Twin::Property::Struct
  8.  
  9. property :username, virtual: true
  10. validates :username, presence: true
  11.  
  12. property :password, virtual: true
  13. validates :password, presence: true
  14.  
  15. # Tried replacing "Struct" with "OpenStruct", "Array", "Hash", etc.
  16. collection :cross_sell, virtual: true, field: :hash, populate_if_empty: Struct do
  17. property :product, virtual: true
  18. property :enabled, virtual: true
  19. property :url, virtual: true
  20. end
  21. end
Add Comment
Please, Sign In to add comment