<commit_before>module ActiveScaffold
  module OrmChecks
    def active_record?
      active_record_class < ActiveRecord::Base
    end

    def mongoid?
      active_record_class < Mongoid::Document
    end

    def _columns
      if active_record_class?
        active_record_class.columns
      elsif mongoid?
        active_record_class.fields.values
      else
        []
      end
    end

    def _columns_hash
      if active_record_class?
        active_record_class.columns_hash
      elsif mongoid?
        active_record_class.fields
      else
        []
      end
    end

    def _content_columns
      if active_record_class?
        active_record_class.content_columns
      elsif mongoid?
        active_record_class.columns.reject { |c| c.name == '_id' }
      else
        []
      end
    end
  end
end<commit_msg>fix initial mongoid support<commit_after>module ActiveScaffold
  module OrmChecks
    def active_record?
      active_record_class < ActiveRecord::Base
    end

    def mongoid?
      active_record_class < Mongoid::Document
    end

    def _columns
      if active_record?
        active_record_class.columns
      elsif mongoid?
        active_record_class.fields.values
      else
        []
      end
    end

    def _columns_hash
      if active_record?
        active_record_class.columns_hash
      elsif mongoid?
        active_record_class.fields
      else
        []
      end
    end

    def _content_columns
      if active_record?
        active_record_class.content_columns
      elsif mongoid?
        active_record_class.columns.reject { |c| c.name == '_id' }
      else
        []
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.04819277108433735, 'fraction_numerical': 0.0, 'mean_word_length': 2.031021897810219, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6698485', 'n_tokens_mistral': 497, 'n_tokens_neox': 488, 'n_words': 106}