Browse files

Added ActiveRecord PostgreSQLColumn and PostgreSQLAdapter sublcass st…

…atements to fix runtime error in non rails project
  • Loading branch information...
1 parent e92fbec commit a76bc09cb34626eacfbcfce54abf7699b7951d94 Matthew Whittaker committed Jan 12, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/activerecord-postgres-hstore/activerecord.rb
4 lib/activerecord-postgres-hstore/activerecord.rb
@@ -176,7 +176,7 @@ def hstore(*args)
- class PostgreSQLColumn
+ class PostgreSQLColumn < Column
# Does the type casting from hstore columns using String#from_hstore or Hash#from_hstore.
def type_cast_code_with_hstore(var_name)
type == :hstore ? "#{var_name}.from_hstore" : type_cast_code_without_hstore(var_name)
@@ -191,7 +191,7 @@ def simplified_type_with_hstore(field_type)
alias_method_chain :simplified_type, :hstore
- class PostgreSQLAdapter
+ class PostgreSQLAdapter < AbstractAdapter
def native_database_types_with_hstore
native_database_types_without_hstore.merge({:hstore => { :name => "hstore" }})

3 comments on commit a76bc09


This seems to break the commit here to get it working on JRuby?


I'll try to setup a travis env for testing in JRuby to avoid this kind of issue.


We're just re-opening classes (PostgreSQLColumn & PostgreSQLAdapter) that are defined by ActiveRecord here. We shouldn't need to include the base classes again. Why would that be different for JRuby?

Please sign in to comment.