Sha256: 593294f2f2781b1ace1c2d4eaf99a4a91915fba41d3f095ebde3f243f210cd6f

Contents?: true

Size: 543 Bytes

Versions: 25

Compression:

Stored size: 543 Bytes

Contents

module ActiveRecord
  module ActsAs
    module Migration
      module TableDefinition
        def actable(options = {})
          name = options.delete(:as) || :actable
          options[:polymorphic] = true
          references(name, options)
        end
      end

      module Table
        include TableDefinition

        def remove_actable(options = {})
          name = options.delete(:as) || :actable
          options[:polymorphic] = true
          @base.remove_reference(@name, name, options)
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
active_record-acts_as-4.0.3 lib/active_record/acts_as/migration.rb
active_record-acts_as-4.0.2 lib/active_record/acts_as/migration.rb
active_record-acts_as-4.0.1 lib/active_record/acts_as/migration.rb
active_record-acts_as-4.0.0 lib/active_record/acts_as/migration.rb
active_record-acts_as-3.1.0 lib/active_record/acts_as/migration.rb
active_record-acts_as-3.0.2 lib/active_record/acts_as/migration.rb
active_record-acts_as-3.0.1 lib/active_record/acts_as/migration.rb
active_record-acts_as-3.0.0 lib/active_record/acts_as/migration.rb
active_record-acts_as-2.5.0 lib/active_record/acts_as/migration.rb
active_record-acts_as-2.4.2 lib/active_record/acts_as/migration.rb
active_record-acts_as-2.4.1 lib/active_record/acts_as/migration.rb
active_record-acts_as-2.4.0 lib/active_record/acts_as/migration.rb
active_record-acts_as-2.3.1 lib/active_record/acts_as/migration.rb
active_record-acts_as-2.3.0 lib/active_record/acts_as/migration.rb
active_record-acts_as-2.2.1 lib/active_record/acts_as/migration.rb
active_record-acts_as-2.2.0 lib/active_record/acts_as/migration.rb
active_record-acts_as-2.1.1 lib/active_record/acts_as/migration.rb
active_record-acts_as-2.1.0 lib/active_record/acts_as/migration.rb
active_record-acts_as-2.0.9 lib/active_record/acts_as/migration.rb
active_record-acts_as-2.0.8 lib/active_record/acts_as/migration.rb