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

Non-ActiveRecord object #6

Open
helphop opened this issue Feb 5, 2019 · 4 comments
Open

Non-ActiveRecord object #6

helphop opened this issue Feb 5, 2019 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@helphop
Copy link

helphop commented Feb 5, 2019

No description provided.

@helphop helphop closed this as completed Feb 5, 2019
@helphop helphop reopened this Feb 5, 2019
@helphop
Copy link
Author

helphop commented Feb 5, 2019

I am using the validator in a form object class as follows:

class QuoteRequestForm
  include ActiveModel::Model
  include NullObject::Conversions

  attr_accessor :name, :email, :time_zone, :file

  validates :file, presence: true, blob: { content_type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' }

end

However, the tests fail as follows:

ArgumentError:
  Unknown validator: 'BlobValidator'

@DeadlockDruid
Copy link

I think you need to include the ActiveRecord::Validations Because the BlobValidator class is defined inside that module.

@aximuseng
Copy link

Same issue here - that include doesn't work

@aki77
Copy link
Owner

aki77 commented Sep 2, 2019

It's difficult because activestorage is closely related to activerecord.

@aki77 aki77 added the help wanted Extra attention is needed label Sep 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants