Skip to content

Commit b8f12ff

Browse files
committed
Add to readme. Remove codeclimate
1 parent d89b893 commit b8f12ff

2 files changed

Lines changed: 14 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,9 @@ jobs:
4545
uses: ruby/setup-ruby@v1
4646
with:
4747
ruby-version: ${{ matrix.ruby_version }}
48-
- name: Before build
49-
run: |
50-
sudo apt-get install libsqlite3-dev
51-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
52-
chmod +x ./cc-test-reporter
53-
./cc-test-reporter before-build
54-
env:
55-
CC_TEST_REPORTER_ID: aff2c7b9e07e54d5fc9e5588d2e2a8bab4f69950d35000edc2b6250bbaba477d
5648
- name: Run test
5749
run: |
5850
bundle update
5951
bundle install --gemfile spec/gemfiles/${{ matrix.gemfile }} --jobs 4 --retry 3
6052
bundle exec rake code_analysis
6153
bundle exec rspec
62-
- name: Report to CodeClimate
63-
run: |
64-
./cc-test-reporter after-build --exit-code 0
65-
env:
66-
CC_TEST_REPORTER_ID: aff2c7b9e07e54d5fc9e5588d2e2a8bab4f69950d35000edc2b6250bbaba477d

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ YAAF (Yet Another Active Form) is a gem that let you create form objects in an e
55
We were going to name this gem `ActiveForm` to follow Rails naming conventions but given there are a lot of form object gems named like that we preferred to go with `YAAF`.
66

77
![CI](https://github.com/rootstrap/yaaf/workflows/CI/badge.svg)
8-
[![Maintainability](https://api.codeclimate.com/v1/badges/c3dea064e1003b700260/maintainability)](https://codeclimate.com/github/rootstrap/yaaf/maintainability)
9-
[![Test Coverage](https://api.codeclimate.com/v1/badges/c3dea064e1003b700260/test_coverage)](https://codeclimate.com/github/rootstrap/yaaf/test_coverage)
108

119
## Table of Contents
1210

@@ -23,6 +21,7 @@ We were going to name this gem `ActiveForm` to follow Rails naming conventions b
2321
- [#save!](#save!)
2422
- [Validations](#validations)
2523
- [Callbacks](#callbacks)
24+
- [Normalizes](#normalizes)
2625
- [Sample app](#sample-app)
2726
- [Links](#links)
2827
- [Development](#development)
@@ -249,6 +248,19 @@ Available callbacks are (listed in execution order):
249248
- `after_save`
250249
- `after_commit/after_rollback`
251250

251+
### Normalizes
252+
253+
`YAAF` form objects support `normalizes` the same way as `ActiveModel` models. For example:
254+
255+
```ruby
256+
class RegistrationForm < YAAF::Form
257+
normalizes :email, with: ->(email) { email.strip.downcase }
258+
normalizes :name, with: ->(name) { name.strip.titleize }
259+
260+
# ...
261+
end
262+
```
263+
252264
## Sample app
253265

254266
You can find a sample app making use of the gem [here](https://yaaf-examples.herokuapp.com). Its code is also open source, and you can find it [here](https://github.com/rootstrap/yaaf-examples).

0 commit comments

Comments
 (0)