Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- validate :valid_users_structure?, if: -> { @users_attribute_is_array }
- def users_attribute_is_array?
- if users.class == Array
- @users_attribute_is_array = true
- true
- else
- errors.add(:users, 'Is not an array')
- false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement