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

Merged
merged 1 commit into from Apr 27, 2018

Conversation

Projects
None yet
3 participants
@fatkodima
Contributor

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 
end

r? @georgeclaghorn @matthewd

@eileencodes eileencodes merged commit ad0220a into rails:master Apr 27, 2018

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
codeclimate All good!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment