Skip to content

Commit bb93ed5

Browse files
committed
seems re-defining primary_key (on postgres) works now with recent AR-4.0
1 parent bcc7080 commit bb93ed5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/arjdbc/postgresql/adapter.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,12 +1504,12 @@ def json(name, options = {})
15041504
class TableDefinition < ActiveRecord::ConnectionAdapters::TableDefinition
15051505
include ColumnMethods
15061506

1507-
# def primary_key(name, type = :primary_key, options = {})
1508-
# return super unless type == :uuid
1509-
# options[:default] ||= 'uuid_generate_v4()'
1510-
# options[:primary_key] = true
1511-
# column name, type, options
1512-
# end if ActiveRecord::VERSION::MAJOR > 3 # 3.2 super expects (name)
1507+
def primary_key(name, type = :primary_key, options = {})
1508+
return super unless type == :uuid
1509+
options[:default] ||= 'uuid_generate_v4()'
1510+
options[:primary_key] = true
1511+
column name, type, options
1512+
end if ActiveRecord::VERSION::MAJOR > 3 # 3.2 super expects (name)
15131513

15141514
def column(name, type = nil, options = {})
15151515
super

0 commit comments

Comments
 (0)