Skip to content
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

Merged
merged 5 commits into from
Mar 10, 2020
Merged

Adding the base form object #1

merged 5 commits into from
Mar 10, 2020

Conversation

juanmanuelramallo
Copy link
Collaborator

  • 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

Gemfile.lock Outdated Show resolved Hide resolved
gem-base.gemspec Outdated Show resolved Hide resolved
gem-base.gemspec Outdated Show resolved Hide resolved
gem-base.gemspec Outdated Show resolved Hide resolved
gem-base.gemspec Outdated Show resolved Hide resolved
gem-base.gemspec Outdated Show resolved Hide resolved
lib/yaaf/base.rb Outdated Show resolved Hide resolved
true
end

def after_commit; end
Copy link
Member

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

Copy link
Collaborator Author

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok ok

lib/yaaf/form.rb Outdated Show resolved Hide resolved
lib/yaaf/form.rb Outdated Show resolved Hide resolved

validate :validate_models

def save
Copy link
Member

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

Copy link
Collaborator Author

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok ok

gem-base.gemspec Outdated Show resolved Hide resolved
spec/yaaf/form_spec.rb Outdated Show resolved Hide resolved
.rubocop.yml Outdated Show resolved Hide resolved
gem-base.gemspec Outdated Show resolved Hide resolved
- 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
yaaf.gemspec Outdated Show resolved Hide resolved
Copy link
Member

@santib santib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

Copy link

@jpascual1994 jpascual1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

spec/support/schema.rb Show resolved Hide resolved
spec/support/models.rb Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants