Sha256: 658a2711354b614c8dc0bde6d491e7dedcefd13beedb45a38dbf68c9c93f3c45

Contents?: true

Size: 768 Bytes

Versions: 11

Compression:

Stored size: 768 Bytes

Contents

module Copyable
  module Declarations
    class Main

      attr_reader :column_list, :association_list, :after_copy_block

      def execute(block)
        self.instance_eval(&block)
      end

      # This declaration doesn't actually *do* anything.  It exists
      # so that any copyable declaration must explicitly state that
      # callbacks and observers are skipped (to make it easier to reason
      # about the code when it is read).
      def disable_all_callbacks_and_observers_except_validate
      end

      def columns(columns)
        @column_list = columns
      end

      def associations(associations)
        @association_list = associations
      end

      def after_copy(&block)
        @after_copy_block = block
      end

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
copyable-0.3.5 lib/copyable/declarations/main.rb
copyable-0.3.3 lib/copyable/declarations/main.rb
copyable-0.3.2 lib/copyable/declarations/main.rb
copyable-0.3.1 lib/copyable/declarations/main.rb
copyable-0.3.0 lib/copyable/declarations/main.rb
copyable-0.2.0 lib/copyable/declarations/main.rb
copyable-0.1.2 lib/copyable/declarations/main.rb
copyable-0.1.1 lib/copyable/declarations/main.rb
copyable-0.1.0 lib/copyable/declarations/main.rb
copyable-0.0.2 lib/copyable/declarations/main.rb
copyable-0.0.1 lib/copyable/declarations/main.rb