Flowdock
get_primary_key(base_name) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/attribute_methods/primary_key.rb, line 89
          def get_primary_key(base_name) #:nodoc:
            if base_name && primary_key_prefix_type == :table_name
              base_name.foreign_key(false)
            elsif base_name && primary_key_prefix_type == :table_name_with_underscore
              base_name.foreign_key
            else
              if ActiveRecord::Base != self && table_exists?
                pk = connection.schema_cache.primary_keys(table_name)
                suppress_composite_primary_key(pk)
              else
                "id"
              end
            end
          end
Register or log in to add new notes.