class CoreField < Field
  # Some CoreField attributes should be read-only
  attr_readonly :name, :as, :collection
  before_destroy :error_on_destroy

  def error_on_destroy
    errors.add_to_base "Core fields cannot be deleted."
  end

  ActiveSupport.run_load_hooks(:fat_free_crm_core_field, self)
end
