title: How to validate inclusion of array content in rails
body: <p>Hi I have an array column in my model: </p>
  
  <pre><code>t.text :sphare, array: true, default: []
  </code></pre>
  
  <p>And I want to validate that it includes only the elements from the list ("Good", "Bad", "Neutral")</p>
  
  <p>My first try was: </p>
  
  <pre><code> validates_inclusion_of :sphare, in: [ ["Good"], ["Bad"], ["Neutral"] ]
  </code></pre>
  
  <p>But when I wanted to create objects with more then one value in sphare ex(["Good", "Bad"] the validator cut it to just ["Good"].</p>
  
  <p>My question is: </p>
  
  <p>How to write a validation that will check only the values of the passed array, without comparing it to fix examples?</p>
  
  <p>Edit added part of my FactoryGirl and test that failds: </p>
  
  <p>Part of my FactoryGirl: </p>
  
  <pre><code>sphare ["Good", "Bad"]
  </code></pre>
  
  <p>and my rspec test: </p>
  
  <pre><code>  it "is not valid with wrong sphare" do
      expect(build(:skill, sphare: ["Alibaba"])).to_not be_valid
    end
   it "is valid with proper sphare" do
      proper_sphare = ["Good", "Bad", "Neutral"]
      expect(build(:skill, sphare: [proper_sphare.sample])).to be_valid
    end  
  </code></pre>