module JamRuby
  class IspScoreBatch < ActiveRecord::Base

    self.primary_key = 'id'
    self.table_name = 'isp_score_batch'
    attr_accessible :json_scoring_data

    validates :json_scoring_data, :presence => true

    validate :json_format

    def json_format
      errors[:json_scoring_data] << "not in json format" unless !json_scoring_data.nil? && json_scoring_data.is_json?
    end
  end
end
