rails/rails — pull request #12716 by kbackowski (2013-10-31 15:42:30+00:00)
Title: Fixed sequence_method for postgres adapter to work in case when there are no sequence for given table.

I have a table in postgresql which doesn't have sequence for primary key :

```
SELECT pg_get_serial_sequence('default_taxes', 'id');
pg_get_serial_sequence
------------------------

(1 row)
```

Calling DefaultTax.sequence_name cause following exception :

```
> DefaultTax.sequence_name
NoMethodError: undefined method `split' for nil:NilClass
from /var/proj/pb-dev3/vendor/gems/ruby/1.9.1/gems/activerecord-3.2.15/lib/active_record/connection_adapters/postgresql_adapter.rb:907:in `default_sequence_name'
from /var/proj/pb-dev3/vendor/gems/ruby/1.9.1/gems/activerecord-3.2.15/lib/active_record/model_schema.rb:196:in `reset_sequence_name'
from /var/proj/pb-dev3/vendor/gems/ruby/1.9.1/gems/activerecord-3.2.15/lib/active_record/model_schema.rb:185:in `sequence_name'
from (irb):1
from /var/proj/pb-dev3/vendor/gems/ruby/1.9.1/gems/railties-3.2.15/lib/rails/commands/console.rb:47:in `start'
from /var/proj/pb-dev3/vendor/gems/ruby/1.9.1/gems/railties-3.2.15/lib/rails/commands/console.rb:8:in `start'
from /var/proj/pb-dev3/vendor/gems/ruby/1.9.1/gems/railties-3.2.15/lib/rails/commands.rb:41:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'
```

This fix converts the result from the ```serial_sequence``` function into string to avoid calling split on nil.

This issue does not exists in rails 4.0.0