<commit_before>require 'active_support/concern'

module NasExtjs::ArExt

    module ExportsAssociations
        extend ActiveSupport::Concern

        included do
            class_attribute :exported_associations
            class_attribute :allowed_attributes
        end

        module ClassMethods



            def export_associations( *associations )
                self.exported_associations ||= []
                associations.flatten!
                options = associations.extract_options!
                associations.each do |m|
                    self.exported_associations << m.to_s
                    accepts_nested_attributes_for( m, options ) if options.delete(:writable)
                end
            end

            def set_other_mass_attributes_allowed( *attrs )
                self.allowed_attributes ||= []
                attrs.each do | attr |
                    self.allowed_attributes << attr.to_s
                end
            end


            def api_allowed_association?( association )
                self.exported_associations && self.exported_associations.include?( association.to_sym )
            end

       end

    end

end


ActiveRecord::Base.send :include, NasExtjs::ArExt::ExportsAssociations
<commit_msg>symbols <> strings.. derp<commit_after>require 'active_support/concern'

module NasExtjs::ArExt

    module ExportsAssociations
        extend ActiveSupport::Concern

        included do
            class_attribute :exported_associations
            class_attribute :allowed_attributes
        end

        module ClassMethods



            def export_associations( *associations )
                self.exported_associations ||= []
                associations.flatten!
                options = associations.extract_options!
                associations.each do |m|
                    self.exported_associations << m.to_sym
                    accepts_nested_attributes_for( m, options ) if options.delete(:writable)
                end
            end

            def set_other_mass_attributes_allowed( *attrs )
                self.allowed_attributes ||= []
                attrs.each do | attr |
                    self.allowed_attributes << attr.to_s
                end
            end


            def api_allowed_association?( association )
                self.exported_associations && self.exported_associations.include?( association.to_sym )
            end

       end

    end

end


ActiveRecord::Base.send :include, NasExtjs::ArExt::ExportsAssociations

{'fraction_non_alphanumeric': 0.06240126382306477, 'fraction_numerical': 0.0, 'mean_word_length': 1.7713347921225382, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 4, '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': '664726', 'n_tokens_mistral': 644, 'n_tokens_neox': 602, 'n_words': 122}