Sha256: fbcf1327a638c32157129a36fdea6e47ae64c7d04d24e3a3b7fff81bea74a0ec

Contents?: true

Size: 388 Bytes

Versions: 7

Compression:

Stored size: 388 Bytes

Contents

module Shortener::ActiveRecordExtension
  def has_shortened_urls
    has_many :shortened_urls, class_name: "::Shortener::ShortenedUrl", as: :owner
  end
end

if Rails::VERSION::MAJOR < 5 && !ActiveRecord::Migration.respond_to?(:[])
  module VersionedMigrationPatch
    def [](*args)
      ActiveRecord::Migration
    end
  end
  ActiveRecord::Migration.extend VersionedMigrationPatch
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
shortener-1.0.1 lib/shortener/active_record_extension.rb
shortener-1.0.0 lib/shortener/active_record_extension.rb
shortener-0.8.2 lib/shortener/active_record_extension.rb
shortener-0.8.1 lib/shortener/active_record_extension.rb
shortener-0.8.0 lib/shortener/active_record_extension.rb
shortener-0.7.2 lib/shortener/active_record_extension.rb
shortener-0.7.1 lib/shortener/active_record_extension.rb