standard-library / microform

Tiny form object pattern for Rails
MIT License
0 stars 0 forks source link

Use delegate class method instead of long-form method definitions #10

Closed jackjennings closed 7 years ago

jackjennings commented 7 years ago

Instead of using def/end style delegation, this changes the project form to use Rails' delegate method to pass certain method calls through to the project.

Alternatively, this could use the Forwardable Ruby library, though we're doing enough Rails-specific stuff in this library that it feels safe to use delegate.

ghost commented 7 years ago

This looks good! Should the other forms, as well as the form template, change as well?

jackjennings commented 7 years ago

Could change them too, though functionally it's the same—this is a bit more concise.