reform 2.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/.travis.yml +11 -0
  4. data/CHANGES.md +415 -0
  5. data/Gemfile +19 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +339 -0
  8. data/Rakefile +15 -0
  9. data/TODO.md +45 -0
  10. data/gemfiles/Gemfile.disposable-0.3 +6 -0
  11. data/lib/reform.rb +8 -0
  12. data/lib/reform/contract.rb +77 -0
  13. data/lib/reform/contract/errors.rb +43 -0
  14. data/lib/reform/contract/validate.rb +33 -0
  15. data/lib/reform/form.rb +94 -0
  16. data/lib/reform/form/call.rb +23 -0
  17. data/lib/reform/form/coercion.rb +3 -0
  18. data/lib/reform/form/composition.rb +34 -0
  19. data/lib/reform/form/dry.rb +67 -0
  20. data/lib/reform/form/module.rb +27 -0
  21. data/lib/reform/form/mongoid.rb +37 -0
  22. data/lib/reform/form/orm.rb +26 -0
  23. data/lib/reform/form/populator.rb +123 -0
  24. data/lib/reform/form/prepopulate.rb +24 -0
  25. data/lib/reform/form/validate.rb +60 -0
  26. data/lib/reform/mongoid.rb +4 -0
  27. data/lib/reform/validation.rb +40 -0
  28. data/lib/reform/validation/groups.rb +73 -0
  29. data/lib/reform/version.rb +3 -0
  30. data/reform.gemspec +29 -0
  31. data/test/benchmarking.rb +26 -0
  32. data/test/call_test.rb +23 -0
  33. data/test/changed_test.rb +41 -0
  34. data/test/coercion_test.rb +66 -0
  35. data/test/composition_test.rb +149 -0
  36. data/test/contract_test.rb +77 -0
  37. data/test/default_test.rb +22 -0
  38. data/test/deprecation_test.rb +27 -0
  39. data/test/deserialize_test.rb +104 -0
  40. data/test/errors_test.rb +165 -0
  41. data/test/feature_test.rb +65 -0
  42. data/test/fixtures/dry_error_messages.yml +44 -0
  43. data/test/form_option_test.rb +24 -0
  44. data/test/form_test.rb +57 -0
  45. data/test/from_test.rb +75 -0
  46. data/test/inherit_test.rb +119 -0
  47. data/test/module_test.rb +142 -0
  48. data/test/parse_pipeline_test.rb +15 -0
  49. data/test/populate_test.rb +270 -0
  50. data/test/populator_skip_test.rb +28 -0
  51. data/test/prepopulator_test.rb +112 -0
  52. data/test/read_only_test.rb +3 -0
  53. data/test/readable_test.rb +30 -0
  54. data/test/readonly_test.rb +14 -0
  55. data/test/reform_test.rb +223 -0
  56. data/test/save_test.rb +89 -0
  57. data/test/setup_test.rb +48 -0
  58. data/test/skip_if_test.rb +74 -0
  59. data/test/skip_setter_and_getter_test.rb +54 -0
  60. data/test/test_helper.rb +49 -0
  61. data/test/validate_test.rb +420 -0
  62. data/test/validation/dry_test.rb +60 -0
  63. data/test/validation/dry_validation_test.rb +352 -0
  64. data/test/validation/errors.yml +4 -0
  65. data/test/virtual_test.rb +24 -0
  66. data/test/writeable_test.rb +29 -0
  67. metadata +265 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 851795d3f1959935496c4a582f24dffc6020b848
4
+ data.tar.gz: f62755eb2d9e6302a00790b703698149838474af
5
+ SHA512:
6
+ metadata.gz: 865c755aea555fedc28f61ae04a7903544ad637c621e656c68a64fc9f952b0a105906f4abc77571dce490099227224cd966c12ccc802b8ae7e830c0b27d108f3
7
+ data.tar.gz: a90c092125bd9f2a7db2a6092267ba3ac439c6d92bd3b2e657a50156128c4de5b8f28e3f62cc2eefc47b6a8f36b1e8d5f94e393f31ab115cf297a60210fc58c4
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ gemfiles/*.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.3
4
+ - 2.0.0
5
+ gemfile:
6
+ - gemfiles/Gemfile.disposable-0.3
7
+
8
+ matrix:
9
+ fast_finish: true
10
+ before_install:
11
+ - gem install bundler
@@ -0,0 +1,415 @@
1
+ ## 2.2.4
2
+
3
+ * Always require `disposable` >= 0.4.1.
4
+
5
+ The only difference here is that `Form#sync`/`#save` with a block will include `nil` properties into the nested hash.
6
+ * Remove `uber` dependency.
7
+
8
+ ## 2.2.3
9
+
10
+ * Add `Form#call` as an alias for `validate` and the `Result` object.
11
+
12
+ ## 2.2.2
13
+
14
+ * Loosen `uber` dependency.
15
+
16
+ ## 2.2.1
17
+
18
+ * Fix `Contract::Properties`. Thanks @simonc. <3
19
+
20
+ ## 2.2.0
21
+
22
+ * Remove `reform/rails`. This is now handled via the `reform-rails` gem which you have to bundle.
23
+ * For coercion, we now use [dry-types](https://github.com/dry-rb/dry-types) as a replacement for the deprecated virtus. You have to change to dry-types' constants, e.g. `type: Types::Form::Bool`.
24
+ * Use disposable 0.3.0. This gives us the long-awaited `nilify: true` option.
25
+
26
+ ####### TODO: fix Module and coercion Types::*
27
+
28
+ ## 2.1.0
29
+
30
+ You should be able to upgrade from 2.0 without any code changes.
31
+
32
+ ### Awesomeness
33
+
34
+ * You can now have `:populator` for scalar properties, too. This allows "parsing code" per property which is super helpful to structure your deserialization.
35
+ * `:populator` can be a method name, as in `populator: :populate_authors!`.
36
+ * Populators can now skip deserialization of a nested fragment using `skip!`. [Learn more here](http://trailblazer.to/gems/reform/populator.html#skip).
37
+ * Added support for dry-validation as a future replacement for ActiveModel::Validation. Note that this is still experimental, but works great.
38
+ * Added validation groups.
39
+
40
+ ### Changes
41
+
42
+ * All lambda APIs change (with deprecation): `populator: ->(options)` or `->(fragment:, model:, **o)` where we only receive one hash instead of a varying number or arguments. This is pretty cool and should be listed under _Awesomeness_.
43
+ * `ActiveModel::Validator` prevents Rails from adding methods to it. This makes `acceptance` and `confirmation` validations work properly.
44
+
45
+ ### Notes
46
+
47
+ * Please be warned that we will drop support for `ActiveModel::Validations` from 2.2 onwards. Don't worry, it will still work, but we don't want to work with it anymore.
48
+
49
+ ## 2.0.5
50
+
51
+ * `ActiveModel::Validator` now delegates all methods properly to the form. It used to crashed with properties called `format` or other private `Object` methods.
52
+ * Simpleform will now properly display fields as required, or not (by introducion `ModelReflections::validators_on`).
53
+ * The `:default` option is not copied into the deserializer anymore from the schema. This requires disposable 0.1.11.
54
+
55
+ ## 2.0.4
56
+
57
+ * `#sync` and `#save` with block now provide `HashWithIndifferentAccess` in Rails.
58
+
59
+ ## 2.0.3
60
+
61
+ * `Form#valid?` is private now. Sorry for the inconvenience, but this has never been documented as public. Reason is that the only entry point for validation is `#validate` to give the form as less public API as possible and minimize misunderstandings.
62
+
63
+ The idea is that you set up the object graph before/while `#validate` and then invoke the validators once.
64
+ * Fixed AM to find proper i18n for error messages. This happens by injecting the form's `model_name` into the `Validator` object in ActiveModel.
65
+
66
+ ## 2.0.2
67
+
68
+ * Fix `unique: true` validation in combination with `Composition`.
69
+ * Use newest Disposable 0.1.9 which does not set `:pass_options` anymore.
70
+
71
+ ## 2.0.1
72
+
73
+ * Fix `ActiveModel::Validations` where translations in custom validations would error. This is now handled by delegating back to the `Validator` object in Reform.
74
+
75
+ ## 2.0.0
76
+
77
+ * The `::reform_2_0!` is no longer there. Guess why.
78
+ * Again: `:empty` doesn't exist anymore. You can choose from `:readable`, `:writeable` and `:virtual`.
79
+ * When using `:populator` the API to work against the form has changed.
80
+ ```ruby
81
+ populator: lambda { |fragment, index, args|
82
+ songs[index] or songs[index] = args.binding[:form].new(Song.new)
83
+ }
84
+ ```
85
+
86
+ is now
87
+
88
+ ```ruby
89
+ populator: lambda { |fragment, index, args|
90
+ songs[index] or songs.insert(index) = Song.new
91
+ }
92
+ ```
93
+ You don't need to know about forms anymore, the twin handles that using the [Twin](https://github.com/apotonick/disposable) API..
94
+
95
+ * `:as` option removed. Use `:from`.
96
+ * With `Composition` included, `Form#model` would give you a composition object. You can grab that using `Form#mapper` now.
97
+ * `Form#update!` is deprecated. It still works but will remind you to override `#present!` or use pre-populators as [described here](http://trailblazerb.org/gems/reform/prepopulator.html) and in the Trailblazer book, chapter "Nested Forms".
98
+ * Forms do not `include ActiveModel::Validations` anymore. This has polluted the entire gem and is not encapsulated in `Validator`. Consider using Lotus Validations instead.
99
+ * Validation inheritance with `ActiveModel::Validations` is broken with Rails 3.2 and 4.0. Update Rails or use the `Lotus` validations.
100
+
101
+ ## 2.0.0.rc3
102
+
103
+ * Fix an annoying bug coming from Rails autoloader with validations and `model_name`.
104
+
105
+ ## 1.2.6
106
+
107
+ * Added `:prepopulate` to fill out form properties for presentation. Note that you need to call `Form#prepopulate!` to trigger the prepopulation.
108
+ * Added support for DateTime properties in forms. Until now, we were ignoring the time part. Thanks to @gdott9 for fixing this.
109
+
110
+ ## 1.2.5
111
+
112
+ * Added `Form#options_for` to have access to all property options.
113
+
114
+ ## 1.2.4
115
+
116
+ * Added `Form#readonly?` to find out whether a field is set to writeable. This is helpful for simple_form to display a disabled input field.
117
+
118
+ ```ruby
119
+ property :title, writeable: false
120
+ ```
121
+
122
+ In the view, you can then use something along the following code.
123
+
124
+ ```ruby
125
+ f.input :title, readonly: @form.readonly?(:title)
126
+ ```
127
+
128
+ ## 1.2.3
129
+
130
+ * Make `ModelReflections` work with simple_form 3.1.0. (#176). It also provides `defined_enums` and `::reflect_on_association` now.
131
+ * `nil` values passed into `#validate` will now be written to the model in `#sync` (#175). Formerly, only blank strings and values evaluating to true were considered when syncing. This allows blanking fields of the model as follows.
132
+
133
+ ```ruby
134
+ form.validate(title: nil)
135
+ ```
136
+ * Calling `Form::reform_2_0!` will now properly inherit to nested forms.
137
+
138
+ ## 1.2.2
139
+
140
+ * Use new `uber` to allow subclassing `reform_2_0!` forms.
141
+ * Raise a better understandable deserialization error when the form is not populated properly. This error is so common that I overcame myself to add a dreaded `rescue` block in `Form#validate`.
142
+
143
+ ## 1.2.1
144
+
145
+ * Fixed a nasty bug where `ActiveModel` forms with form builder support wouldn't deserialize properly. A million Thanks to @karolsarnacki for finding this and providing an exemplary failing test. <3
146
+
147
+ ## 1.2.0
148
+
149
+ ### Breakage
150
+
151
+ * Due to countless bugs we no longer include support for simple_form's type interrogation automatically. This allows using forms with non-AM objects. If you want full support for simple_form do as follows.
152
+
153
+ ```ruby
154
+ class SongForm < Reform::Form
155
+ include ModelReflections
156
+ ```
157
+
158
+ Including this module will add `#column_for_attribute` and other methods need by form builders to automatically guess the type of a property.
159
+
160
+ * `Form#save` no longer passed `self` to the block. You've been warned long enough. ;)
161
+
162
+ ### Changes
163
+
164
+ * Renamed `:as` to `:from` to be in line with Representable/Roar, Disposable and Cells. Thanks to @bethesque for pushing this.
165
+ * `:empty` is now `:virtual` and `:virtual` is `writeable: false`. It was too confusing and sucked. Thanks to @bethesque, again, for her moral assistance.
166
+ * `Form#save` with `Composition` now returns true only if all composite models saved.
167
+ * `Form::copy_validations_from` allows copying custom validators now.
168
+ * New call style for `::properties`. Instead of an array, it's now `properties :title, :genre`.
169
+ * All options are evaluated with `pass_options: true`.
170
+ * All transforming representers are now created and stored on class level, resulting in simpler code and a 85% speed-up.
171
+
172
+ ### New Stuff!!!
173
+
174
+ * In `#validate`, you can ignore properties now using `:skip_if`.
175
+
176
+ ```ruby
177
+ property :hit, skip_if: lambda { |fragment, *| fragment["title"].blank? }
178
+ ```
179
+
180
+ This works for both properties and nested forms. The property will simply be ignored when deserializing, as if it had never been in the incoming hash/document.
181
+
182
+ For nested properties you can use `:skip_if: :all_blank` as a macro to ignore a nested form if all values are blank.
183
+ * You can now specify validations right in the `::property` call.
184
+
185
+ ```ruby
186
+ property :title, validates: {presence: true}
187
+ ```
188
+
189
+ Thanks to @zubin for this brillant idea!
190
+
191
+ * Reform now tracks which attributes have changed after `#validate`. You can check that using `form.changed?(:title)`.
192
+ * When including `Sync::SkipUnchanged`, the form won't try to assign unchanged values anymore in `#sync`. This is extremely helpful when handling file uploads and the like.
193
+ * Both `#sync` and `#save` can be configured dynamically now.
194
+
195
+ When syncing, you can run a lambda per property.
196
+
197
+ ```ruby
198
+ property :title, sync: lambda { |value, options| model.set_title(value) }
199
+ ```
200
+
201
+ This won't run Reform's built-in sync for this property.
202
+
203
+ You can also provide the sync lambda at run-time.
204
+
205
+ ```ruby
206
+ form.sync(title: lambda { |value, options| form.model.title = "HOT: #{value}" })
207
+ ```
208
+
209
+ This block is run in the caller's context allowing you to access environment variables.
210
+
211
+ Note that the dynamic sync happens _before_ save, so the model id may unavailable.
212
+
213
+ You can do the same for saving.
214
+
215
+ ```ruby
216
+ form.save(title: lambda { |value, options| form.model.title = "#{form.model.id} --> #{value}" })
217
+ ```
218
+ Again, this block is run in the caller's context.
219
+
220
+ The two features are an excellent way to handle file uploads without ActiveRecord's horrible callbacks.
221
+
222
+ * Adding generic `:base` errors now works. Thanks to @bethesque.
223
+
224
+ ```ruby
225
+ errors.add(:base, "You are too awesome!")
226
+ ```
227
+
228
+ This will prefix the error with `:base`.
229
+ * Need your form to parse JSON? Include `Reform::Form::JSON`, the `#validate` method now expects a JSON string and will deserialize and populate the form from the JSON document.
230
+ * Added `Form::schema` to generate a pure representer from the form's representer.
231
+ * Added `:readable` and `:writeable` option which allow to skip reading or writing to the model when `false`.
232
+
233
+ ## 1.1.1
234
+
235
+ * Fix a bug where including a form module would mess up the options has of the validations (under older Rails).
236
+ * Fix `::properties` which modified the options hash while iterating properties.
237
+ * `Form#save` now returns the result of the `model.save` invocation.
238
+ * Fix: When overriding a reader method for a nested form for presentation (e.g. to provide an initial new record), this reader was used in `#update!`. The deserialize/update run now grabs the actual nested form instances directly from `fields`.
239
+ * `Errors#to_s` is now delegated to `messages.to_s`. This is used in `Trailblazer::Operation`.
240
+
241
+ ## 1.1.0
242
+
243
+ * Deprecate first block argument in save. It's new signature is `save { |hash| }`. You already got the form instance when calling `form.save` so there's no need to pass it into the block.
244
+ * `#validate` does **not** touch any model anymore. Both single values and collections are written to the model after `#sync` or `#save`.
245
+ * Coercion now happens in `#validate`, only.
246
+ * You can now define forms in modules including `Reform::Form::Module` to improve reusability.
247
+ * Inheriting from forms and then overriding/extending properties with `:inherit` now works properly.
248
+ * You can now define methods in inline forms.
249
+ * Added `Form::ActiveModel::ModelValidations` to copy validations from model classes. Thanks to @cameron-martin for this fine addition.
250
+ * Forms can now also deserialize other formats, e.g. JSON. This allows them to be used as a contract for API endpoints and in Operations in Trailblazer.
251
+ * Composition forms no longer expose readers to the composition members. The composition is available via `Form#model`, members via `Form#model[:member_name]`.
252
+ * ActiveRecord support is now included correctly and passed on to nested forms.
253
+ * Undocumented/Experimental: Scalar forms. This is still WIP.
254
+
255
+ ## 1.0.4
256
+
257
+ Reverting what I did in 1.0.3. Leave your code as it is. You may override a writers like `#title=` to sanitize or filter incoming data, as in
258
+
259
+ ```ruby
260
+ def title=(v)
261
+ super(v.strip)
262
+ end
263
+ ```
264
+
265
+ This setter will only be called in `#validate`.
266
+
267
+ Readers still work the same, meaning that
268
+
269
+ ```ruby
270
+ def title
271
+ super.downcase
272
+ end
273
+ ```
274
+
275
+ will result in lowercased title when rendering the form (and only then).
276
+
277
+ The reason for this confusion is that you don't blog enough about Reform. Only after introducing all those deprecation warnings, people started to contact me to ask what's going on. This gave me the feedback I needed to decide what's the best way for filtering incoming data.
278
+
279
+ ## 1.0.3
280
+
281
+ * Systematically use `fields` when saving the form. This avoids calling presentational readers that might have been defined by the user.
282
+
283
+ ## 1.0.2
284
+
285
+ * The following property names are reserved and will raise an exception: `[:model, :aliased_model, :fields, :mapper]`
286
+ * You get warned now when overriding accessors for your properties:
287
+
288
+ ```ruby
289
+ property :title
290
+
291
+ def title
292
+ super.upcase
293
+ end
294
+ ```
295
+
296
+ This is because in Reform 1.1, those accessors will only be used when rendering the form, e.g. when doing `= @form.title`. If you override the accessors for presentation, only, you're fine. Add `presentation_accessors: true` to any property, the warnings will be suppressed and everything's gonna work. You may remove `presentation_accessors: true` in 1.1, but it won't affect the form.
297
+
298
+ However, if you used to override `#title` or `#title=` to manipulate incoming data, this is no longer working in 1.1. The reason for this is to make Reform cleaner. You will get two options `:validate_processor` and `:sync_processor` in order to filter data when calling `#validate` and when syncing data back to the model with `#sync` or `#save`.
299
+
300
+ ## 1.0.1
301
+
302
+ * Deprecated model readers for `Composition` and `ActiveModel`. Consider the following setup.
303
+ ```ruby
304
+ class RecordingForm < Reform::Form
305
+ include Composition
306
+
307
+ property :title, on: :song
308
+ end
309
+ ```
310
+
311
+ Before, Reform would allow you to do `form.song` which returned the song model. You can still do this (but you shouldn't) with `form.model[:song]`.
312
+
313
+ This allows having composed models and properties with the same name. Until 1.1, you have to use `skip_accessors: true` to advise Reform _not_ to create the deprecated accessor.
314
+
315
+ Also deprecated is the alias accessor as found with `ActiveModel`.
316
+ ```ruby
317
+ class RecordingForm < Reform::Form
318
+ include Composition
319
+ include ActiveModel
320
+
321
+ model :hit, on: :song
322
+ end
323
+ ```
324
+ Here, an automatic reader `Form#hit` was created. This is deprecated as
325
+
326
+ This is gonna be **removed in 1.1**.
327
+
328
+
329
+ ## 1.0.0
330
+
331
+ * Removed `Form::DSL` in favour of `Form::Composition`.
332
+ * Simplified nested forms. You can now do
333
+ ```ruby
334
+ validates :songs, :length => {:minimum => 1}
335
+ validates :hit, :presence => true
336
+ ```
337
+ * Allow passing symbol hash keys into `#validate`.
338
+ * Unlimited nesting of forms, if you really want that.
339
+ * `save` gets called on all nested forms automatically, disable with `save: false`.
340
+ * Renaming with `as:` now works everywhere.
341
+ * Fixes to make `Composition` work everywhere.
342
+ * Extract setup and validate into `Contract`.
343
+ * Automatic population with `:populate_if_empty` in `#validate`.
344
+ * Remove `#from_hash` and `#to_hash`.
345
+ * Introduce `#sync` and make `#save` less smart.
346
+
347
+ ## 0.2.7
348
+
349
+ * Last release supporting Representable 1.7.
350
+ * In ActiveModel/ActiveRecord: The model name is now correctly infered even if the name is something like `Song::Form`.
351
+
352
+ ## 0.2.6
353
+
354
+ * Maintenance release cause I'm stupid.
355
+
356
+ ## 0.2.5
357
+
358
+ * Allow proper form inheritance. When having `HitForm < SongForm < Reform::Form` the `HitForm` class will contain `SongForm`'s properties in addition to its own fields.
359
+ * `::model` is now inherited properly.
360
+ * Allow instantiation of nested form with emtpy nested properties.
361
+
362
+ ## 0.2.4
363
+
364
+ * Accessors for properties (e.g. `title` and `title=`) can now be overridden in the form *and* call `super`. This is extremely helpful if you wanna do "manual coercion" since the accessors are invoked in `#validate`. Thanks to @cj for requesting this.
365
+ * Inline forms now know their class name from the property that defines them. This is needed for I18N where `ActiveModel` queries the class name to compute translation keys. If you're not happy with it, use `::model`.
366
+
367
+ ## 0.2.3
368
+
369
+ * `#form_for` now properly recognizes a nested form when declared using `:form` (instead of an inline form).
370
+ * Multiparameter dates as they're constructed from the Rails date helper are now processed automatically. As soon as an incoming attribute name is `property_name(1i)` or the like, it's compiled into a Date. That happens in `MultiParameterAttributes`. If a component (year/month/day) is missing, the date is considered `nil`.
371
+
372
+ ## 0.2.2
373
+
374
+ * Fix a bug where `form.save do .. end` would call `model.save` even though a block was given. This no longer happens, if there's a block to `#save`, you have to manually save data (ActiveRecord environment, only).
375
+ * `#validate` doesn't blow up anymore when input data is missing for a nested property or collection.
376
+ * Allow `form: SongForm` to specify an explicit form class instead of using an inline form for nested properties.
377
+
378
+ ## 0.2.1
379
+
380
+ * `ActiveRecord::i18n_scope` now returns `activerecord`.
381
+ * `Form#save` now calls save on the model in `ActiveRecord` context.
382
+ * `Form#model` is public now.
383
+ * Introduce `:empty` to have empty fields that are accessible for validation and processing, only.
384
+ * Introduce `:virtual` for read-only fields the are like `:empty` but initially read from the decorated model.
385
+ * Fix uniqueness validation with `Composition` form.
386
+ * Move `setup` and `save` logic into respective representer classes. This might break your code in case you overwrite private reform classes.
387
+
388
+
389
+ ## 0.2.0
390
+
391
+ * Added nested property and collection for `has_one` and `has_many` relationships. . Note that this currently works only 1-level deep.
392
+ * Renamed `Reform::Form::DSL` to `Reform::Form::Composition` and deprecated `DSL`.
393
+ * `require 'reform'` now automatically requires Rails stuff in a Rails environment. Mainly, this is the FormBuilder compatibility layer that is injected into `Form`. If you don't want that, only require 'reform/form'.
394
+ * Composition now totally optional
395
+ * `Form.new` now accepts one argument, only: the model/composition. If you want to create your own representer, inject it by overriding `Form#mapper`. Note that this won't create property accessors for you.
396
+ * `Form::ActiveModel` no longer creates accessors to your represented models, e.g. having `property :title, on: :song` doesn't allow `form.song` anymore. This is because the actual model and the form's state might differ, so please use `form.title` directly.
397
+
398
+ ## 0.1.3
399
+
400
+ * Altered `reform/rails` to conditionally load `ActiveRecord` code and created `reform/active_record`.
401
+
402
+ ## 0.1.2
403
+
404
+ * `Form#to_model` is now delegated to model.
405
+ * Coercion with virtus works.
406
+
407
+ ## 0.1.1
408
+
409
+ * Added `reform/rails` that requires everything you need (even in other frameworks :).
410
+ * Added `Form::ActiveRecord` that gives you `validates_uniqueness_with`. Note that this is strongly coupled to your database, thou.
411
+ * Merged a lot of cleanups from sweet @parndt <3.
412
+
413
+ ## 0.1.0
414
+
415
+ * Oh yeah.