Sha256: 9a9275530fec158cd8a7c782088d6ed2b0028bb02357a06139b25c59baa58f05

Contents?: true

Size: 493 Bytes

Versions: 71

Compression:

Stored size: 493 Bytes

Contents

require 'roda/component/form'

module Forms
  class Login < Roda::Component::Form
    attr_accessor :email, :password, :password_confirmation, :first_name, :last_name, :signup

    def validate
      assert_present :email
      assert_email :email
      assert_present :password

      if signup
        assert_present :first_name
        assert_present :last_name
        assert_present :password_confirmation
        assert_equal :password_confirmation, password
      end
    end
  end
end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
roda-component-0.1.53 test/dummy/components/forms/login.rb
roda-component-0.1.52 test/dummy/components/forms/login.rb
roda-component-0.1.51 test/dummy/components/forms/login.rb
roda-component-0.1.50 test/dummy/components/forms/login.rb
roda-component-0.1.49 test/dummy/components/forms/login.rb
roda-component-0.1.48 test/dummy/components/forms/login.rb
roda-component-0.1.47 test/dummy/components/forms/login.rb
roda-component-0.1.46 test/dummy/components/forms/login.rb
roda-component-0.1.45 test/dummy/components/forms/login.rb
roda-component-0.1.44 test/dummy/components/forms/login.rb
roda-component-0.1.43 test/dummy/components/forms/login.rb
roda-component-0.1.42 test/dummy/components/forms/login.rb
roda-component-0.1.41 test/dummy/components/forms/login.rb
roda-component-0.1.40 test/dummy/components/forms/login.rb
roda-component-0.1.39 test/dummy/components/forms/login.rb
roda-component-0.1.38 test/dummy/components/forms/login.rb
roda-component-0.1.37 test/dummy/components/forms/login.rb
roda-component-0.1.36 test/dummy/components/forms/login.rb
roda-component-0.1.35 test/dummy/components/forms/login.rb
roda-component-0.1.34 test/dummy/components/forms/login.rb