Skip to content

Commit

Permalink
monkeypatch native_database_types to include hstore, allowing dump_sc…
Browse files Browse the repository at this point in the history
…hema to work properly and Rails schema generation to function.
  • Loading branch information
Brian Ledbetter committed Nov 30, 2010
1 parent 2a92f26 commit 50aaff6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/activerecord-postgres-hstore/activerecord.rb
Expand Up @@ -137,6 +137,11 @@ class PostgreSQLAdapter < AbstractAdapter

alias :old_quote :quote
alias :old_columns :columns
alias :old_native_database_types :native_database_types

def native_database_types
old_native_database_types.merge({:hstore => { :name => "hstore" }})
end

# Quotes correctly a hstore column value.
def quote(value, column = nil)
Expand All @@ -148,4 +153,4 @@ def quote(value, column = nil)
end
end
end
end
end

0 comments on commit 50aaff6

Please sign in to comment.