Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added ActiveRecord PostgreSQLColumn and PostgreSQLAdapter sublcass st…

…atements to fix runtime error in non rails project
  • Loading branch information...
commit a76bc09cb34626eacfbcfce54abf7699b7951d94 1 parent e92fbec
Matthew Whittaker authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/activerecord-postgres-hstore/activerecord.rb
4 lib/activerecord-postgres-hstore/activerecord.rb
View
@@ -176,7 +176,7 @@ def hstore(*args)
end
- 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
end
- class PostgreSQLAdapter
+ class PostgreSQLAdapter < AbstractAdapter
def native_database_types_with_hstore
native_database_types_without_hstore.merge({:hstore => { :name => "hstore" }})
end

3 comments on commit a76bc09

Jeff Cole

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

Diogo Biazus
Owner

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

Tee Parham

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.
Something went wrong with that request. Please try again.