Sha256: 0c8b163f61f85c163f64799c2942c80c7027e4edd548c05ccbdb970f84c490d2

Contents?: true

Size: 648 Bytes

Versions: 8

Compression:

Stored size: 648 Bytes

Contents

class CreateAssociations < ActiveRecord::Migration::Current
  include ActiveRecord::Concerns::Base

  #########################################
  #########################################

    # Up
    def up
      setup_uuid
      create_table table, uuid do |t|
    		t.references  :associatiable, { polymorphic: true }.merge!(uuid(:type)) # => http://stackoverflow.com/a/29257570/1143732
    		t.references  :associated, 	  { polymorphic: true }.merge!(uuid(:type)) # => http://stackoverflow.com/a/29257570/1143732
    		t.timestamps
    	end
    end

  #########################################
  #########################################

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fl-0.3.8 db/migrate/20160710095916_create_associations.rb
fl-0.3.6 db/migrate/20160710095916_create_associations.rb
fl-0.3.5 db/migrate/20160710095916_create_associations.rb
fl-0.3.4 db/migrate/20160710095916_create_associations.rb
fl-0.3.3 db/migrate/20160710095916_create_associations.rb
fl-0.3.2 db/migrate/20160710095916_create_associations.rb
fl-0.3.1 db/migrate/20160710095916_create_associations.rb
fl-0.3.0 db/migrate/20160710095916_create_associations.rb