Basically I want to validate that the url provided does not include yahoo, goolge, twitter, or facebook, I was really trying to complete this with an inline lambda. But each test I do has either raised an error, or did not block the word from the list.
I've tried each of the following... and others...
validates_exclusion_of :url, in: %w[twitter google facebook yahoo]
validates_exclusion_of :url, with: ->(link) {%w[twitter google facebook yahoo].all?{ |x| !!link[x] } }
validates_exclusion_of :url, in: ->(link) {%w[twitter google facebook yahoo].all?{ |x| !!link[x] } }
validates :url, exclusion: { in: %w[twitter google facebook yahoo]
validates ->(:url){ %w[twitter google facebook yahoo].any? {|y| !!:url[y]}.(:url)
validates :url, :with lambda { %w[twitter google facebook yahoo].any? { |y| !!:url[y] } }
validates :url, with: (not %w[twitter google facebook yahoo].any?{|y|if(:url.nil?)false;end;!!:url[y]})
validates :url, with: (not %w[twitter google facebook yahoo].any?{ |y| :url.nil? ? false : !!:url[y] })
validates :url, with: (not %w[twitter google facebook yahoo].any?{ |y| (not !!:url) ? false : !!:url[y] })
validates :url, with: (not %w[twitter google facebook yahoo].any?{ |y| !!defined?(:url) && not :url.nil? ? false : !!:url[y] })
validates :url, with: (not (%w[twitter google facebook yahoo]).any?{ |y| defined?(:url) ? false : :url[y] })
validates_with (not (%w[twitter google facebook yahoo]).any?{ |y| defined?(:url) ? false : :url[y] })
What lambda and validator helper would work for for this?