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.73 test/dummy/components/forms/login.rb
roda-component-0.1.72 test/dummy/components/forms/login.rb
roda-component-0.1.71 test/dummy/components/forms/login.rb
roda-component-0.1.70 test/dummy/components/forms/login.rb
roda-component-0.1.69 test/dummy/components/forms/login.rb
roda-component-0.1.68 test/dummy/components/forms/login.rb
roda-component-0.1.67 test/dummy/components/forms/login.rb
roda-component-0.1.66 test/dummy/components/forms/login.rb
roda-component-0.1.65 test/dummy/components/forms/login.rb
roda-component-0.1.64 test/dummy/components/forms/login.rb
roda-component-0.1.63 test/dummy/components/forms/login.rb
roda-component-0.1.62 test/dummy/components/forms/login.rb
roda-component-0.1.61 test/dummy/components/forms/login.rb
roda-component-0.1.60 test/dummy/components/forms/login.rb
roda-component-0.1.59 test/dummy/components/forms/login.rb
roda-component-0.1.58 test/dummy/components/forms/login.rb
roda-component-0.1.57 test/dummy/components/forms/login.rb
roda-component-0.1.56 test/dummy/components/forms/login.rb
roda-component-0.1.55 test/dummy/components/forms/login.rb
roda-component-0.1.54 test/dummy/components/forms/login.rb