-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding the base form object #1
Conversation
juanmanuelramallo
commented
Feb 13, 2020
- Added the initial implmentation of the form object
- Added a basic spec
- Added support for ActiveRecord in specs with an sqlit3 adapter and an in-memory db
true | ||
end | ||
|
||
def after_commit; end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all these hooks can be private. Try it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we can do these in a subsequent PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok ok
|
||
validate :validate_models | ||
|
||
def save |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have save!
to provide a similar API such as ActiveModel ?
def save!
save_in_transaction
after_commit
end
def save
before_validation
return false if invalid?
save!
true
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it! Definitely, do you think a subsequent PR would work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok ok
- Added the initial implmentation of the form object - Added a basic spec - Added support for ActiveRecord in specs with an sqlit3 adapter and an in-memory db
- Adding database cleaner - Improving specs - Updating gemspec
7af7f2a
to
baac62b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
05660aa
to
f5898c1
Compare