Skip to content

Commit

Permalink
Merge branch 'master' of github.com:apotonick/reform
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed May 6, 2014
2 parents 4b248af + 144c37b commit fd8602d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
10 changes: 7 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@
```
* Allow passing symbol hash keys into `#validate`.
* Unlimited nesting of forms, if you really want that.
save on all nested, disable with save: false
composition simplified, empty fields, save ("everything works with everything")
* as: now works
* `save` gets called on all nested forms automatically, disable with `save: false`.
* Renaming with `as:` now works everywhere.
* Fixes to make `Composition` work everywhere.
* Extract setup and validate into `Contract`.
* Automatic population with `:populate_if_empty` in `#validate`.
* Remove `#from_hash` and `#to_hash`.
* Introduce `#sync` and make `#save` less smart.

## 0.2.7

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Add this line to your Gemfile:
gem 'reform'
```

## Nomenklatura
## Nomenclatura

Reform comes with two base classes.

Expand Down Expand Up @@ -193,7 +193,7 @@ class AlbumContract < Reform::Contract

It defines the validations and the object graph to be inspected.

In future versions and with the upcoming [Trailblazer framework](https://github.com/apotonick/trailblazer), contracts can be inherited from forms, representers, and cells, and vice-versa.
In future versions and with the upcoming [Trailblazer framework](https://github.com/apotonick/trailblazer), contracts can be inherited from forms, representers, and cells, and vice-versa. Actually this already works with representer inheritance - let me know if you need help.

### Using Contracts

Expand Down
5 changes: 5 additions & 0 deletions lib/reform/contract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ def create_accessor(name)
include Validate


def errors # FIXME: this is needed for Rails 3.0 compatibility.
@errors ||= Errors.new(self)
end


private
attr_accessor :fields
attr_writer :errors # only used in top form. (is that true?)
Expand Down
2 changes: 1 addition & 1 deletion lib/reform/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Reform
VERSION = "0.2.7"
VERSION = "1.0.0"
end

0 comments on commit fd8602d

Please sign in to comment.