Skip to content

Commit

Permalink
Include ActiveModel::Model
Browse files Browse the repository at this point in the history
This wil give us the validates method.

This was previously failing with:

An error occurred while loading ./spec/validators/phone_validator_spec.rb.
Failure/Error: validates :phone_number, phone: true
  • Loading branch information
avinhurry committed Sep 2, 2024
1 parent df60cdf commit 8bd1959
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/validators/email_address_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

let(:model) do
Class.new do
include ActiveRecord::Validations
include ActiveModel::Model

attr_accessor :email

Expand Down
2 changes: 1 addition & 1 deletion spec/validators/phone_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'rails_helper'

class PhoneValidatorTest
include ActiveRecord::Validations
include ActiveModel::Model

attr_accessor :phone_number

Expand Down

0 comments on commit 8bd1959

Please sign in to comment.