My problem is: the code below works fine but there is one special case. If item’s product_id is 1 then item can have up to 10 keywords. Any help will be appreciated.Thanks
class Item < ActiveRecord::Base
validates_length_of :keywords, :maximum => 5, :tokenizer => lambda {|str| str.scan(/\w+/) }, :on => :update
end
1 Answer