<commit_before>module Slingshot
  module Model

    module Persistence

      module Storage

        def self.included(base)

          base.class_eval do
            extend  ClassMethods
            include InstanceMethods            
          end

        end

        module ClassMethods

          def create(args={})
            document    = new(args)
            response    = document.update_index
            document.id = response['_id']
            document
          end

        end

        module InstanceMethods

          def update_attribute(name, value)
            send("#{name}=", value)
            save
          end

          def update_attributes(attributes={})
            @attributes = attributes
            save
          end

          def save
            run_callbacks :save do
            end
            self
          end

          def destroy
            run_callbacks :destroy do
              @destroyed = true
            end
            self.freeze
          end

          def destroyed?; !!@destroyed; end

        end

      end

    end

  end
end<commit_msg>Added Model#persisted? to Model::Persistence<commit_after>module Slingshot
  module Model

    module Persistence

      module Storage

        def self.included(base)

          base.class_eval do
            extend  ClassMethods
            include InstanceMethods            
          end

        end

        module ClassMethods

          def create(args={})
            document    = new(args)
            response    = document.update_index
            document.id = response['_id']
            document
          end

        end

        module InstanceMethods

          def update_attribute(name, value)
            send("#{name}=", value)
            save
          end

          def update_attributes(attributes={})
            @attributes = attributes
            save
          end

          def save
            run_callbacks :save do
            end
            self
          end

          def destroy
            run_callbacks :destroy do
              @destroyed = true
            end
            self.freeze
          end

          def destroyed?; !!@destroyed; end

          def persisted?; id;           end

        end

      end

    end

  end
end
{'fraction_non_alphanumeric': 0.049344978165938864, 'fraction_numerical': 0.0, 'mean_word_length': 1.1154201292705448, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1357552', 'n_tokens_mistral': 550, 'n_tokens_neox': 518, 'n_words': 152}