Sha256: 1cc1ce55fd4254cd278fd824238c0b883d2257dbcddbeae7f764ff7626cd6b19

Contents?: true

Size: 550 Bytes

Versions: 11

Compression:

Stored size: 550 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(@table_name, name, options)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
active_record-acts_as-1.0.8 lib/active_record/acts_as/migration.rb
active_record-acts_as-1.0.7 lib/active_record/acts_as/migration.rb
active_record-acts_as-1.0.6 lib/active_record/acts_as/migration.rb
active_record-acts_as-1.0.5 lib/active_record/acts_as/migration.rb
active_record-acts_as-1.0.4 lib/active_record/acts_as/migration.rb
active_record-acts_as-1.0.3 lib/active_record/acts_as/migration.rb
active_record-acts_as-1.0.2 lib/active_record/acts_as/migration.rb
active_record-acts_as-1.0.1 lib/active_record/acts_as/migration.rb
active_record-acts_as-1.0.0 lib/active_record/acts_as/migration.rb
active_record-acts_as-1.0.0.rc lib/active_record/acts_as/migration.rb
active_record-acts_as-1.0.0.pre lib/active_record/acts_as/migration.rb