Displaying 1 result from an estimated 1 matches for "_id_seq".
Did you mean:
t_id_seq
2005 Aug 23
0
Fixtures: pluraly bitten
...tten.each do |table|
table_class = Inflector.classify(table.to_s)
if Object.const_defined?(table_class)
pk = eval("#{table_class}::primary_key")
if pk == ''id''
connection.execute(
"SELECT setval(''#{table.to_s}_id_seq'', (SELECT MAX(id) FROM
#{table.to_s}), true)",
''Setting Sequence''
)
end
end
end
end
The smelly line in there is
Inflector.classify(table.to_s)
which simply auto-singularizes and camel cases the table name. A thing
tha...