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

has_(one/many)_attached presence validation #31956



Copy link

@fatkodima fatkodima commented Feb 11, 2018

Convenient way to check attachments presence.

class User < ActiveRecord::Base
  has_one_attached :avatar
  has_many_attached :highlights

  validates :avatar, presence: true
  validates :highlights, presence: true 

r? @georgeclaghorn @matthewd

@eileencodes eileencodes merged commit ad0220a into rails:master Apr 27, 2018
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build failed
codeclimate All good!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.