Commit 65af43e6 by Jmarques Committed by Cuong Tran

Adding hstore to no default column types (#382)

parent b5a201d9
......@@ -61,7 +61,7 @@ module AnnotateModels
NO_LIMIT_COL_TYPES = %w(integer boolean)
# Don't show default value for these column types
NO_DEFAULT_COL_TYPES = %w(json jsonb)
NO_DEFAULT_COL_TYPES = %w(json jsonb hstore)
class << self
def annotate_pattern(options = {})
......
......@@ -153,11 +153,12 @@ EOS
EOS
end
it "should ignore default value of json columns " do
it "should ignore default value of json and hstore columns " do
klass = mock_class(:users, nil, [
mock_column(:id, :integer),
mock_column(:profile, :json, :default => '{}'),
mock_column(:settings, :jsonb, :default => '{}')
mock_column(:profile, :json, :default => '{}'),
mock_column(:settings, :jsonb, :default => '{}'),
mock_column(:parameters, :hstore, :default => '{}'),
])
expect(AnnotateModels.get_schema_info(klass, "Schema Info")).to eql(<<-EOS)
......@@ -165,9 +166,10 @@ EOS
#
# Table name: users
#
# id :integer not null
# profile :json not null
# settings :jsonb not null
# id :integer not null
# profile :json not null
# settings :jsonb not null
# parameters :hstore not null
#
EOS
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment