Permalink
Browse files

Revert "Merge pull request #10455 from patricksrobertson/bigserial_id…

…_not_identifying_pk"

This reverts commit 3043d45, reversing
changes made to ca0275d.
  • Loading branch information...
1 parent 3043d45 commit 2b5e4f7f983a891bfcf288fba386cc534e64223e @tenderlove tenderlove committed May 7, 2013
@@ -359,12 +359,8 @@ class TableDefinition < ActiveRecord::ConnectionAdapters::TableDefinition
# a record (as primary keys cannot be +nil+). This might be done via the
# +SecureRandom.uuid+ method and a +before_save+ callback, for instance.
def primary_key(name, type = :primary_key, options = {})
- return super unless type = :primary_key
-
- if type == :uuid
- options[:default] = options.fetch(:default, 'uuid_generate_v4()')
- end
-
+ return super unless type == :uuid
+ options[:default] = options.fetch(:default, 'uuid_generate_v4()')
options[:primary_key] = true
column name, type, options
end
@@ -216,32 +216,3 @@ def test_primaery_key_method_with_ansi_quotes
end
end
-if current_adapter?(:PostgreSQLAdapter)
- class PrimaryKeyBigSerialTest < ActiveRecord::TestCase
- self.use_transactional_fixtures = false
-
- class Widget < ActiveRecord::Base
- end
-
- def setup
- @con = ActiveRecord::Base.connection
-
- ActiveRecord::Schema.define do
- create_table :widgets, id: :bigserial do |t|
- end
- end
- end
-
- def teardown
- ActiveRecord::Schema.define do
- drop_table :widgets
- end
- end
-
- def test_bigserial_primary_key
- widget = Widget.create!
-
- assert_not_nil widget.id
- end
- end
-end

0 comments on commit 2b5e4f7

Please sign in to comment.