Skip to content

Commit

Permalink
Merge pull request afair#11 from gocardless/v0.5-rails-4.0-fixes
Browse files Browse the repository at this point in the history
V0.5 rails 4.0 fixes
  • Loading branch information
afair committed Jun 9, 2014
2 parents a939533 + 40abf5c commit efe956d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion active_record/connection_adapters/postgresql/get_type_map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ module ActiveRecord
module ConnectionAdapters
module PostgreSQL
def get_type_map
type_map
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR == 0
::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID::TYPE_MAP
else
type_map
end
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/postgresql_cursor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
require 'active_record'
require 'active_record/connection_adapters/postgresql_adapter'
ActiveRecord::Base.extend(PostgreSQLCursor::ActiveRecord::SqlCursor)
ActiveRecord::Relation.include(PostgreSQLCursor::ActiveRecord::Relation::CursorIterators)
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.include(PostgreSQLCursor::ActiveRecord::ConnectionAdapters::PostgreSQLTypeMap)
ActiveRecord::Relation.send(:include, PostgreSQLCursor::ActiveRecord::Relation::CursorIterators)
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send(:include, PostgreSQLCursor::ActiveRecord::ConnectionAdapters::PostgreSQLTypeMap)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ module ConnectionAdapters
module PostgreSQLTypeMap
# Returns the private "type_map" needed for the cursor operation
def get_type_map # :nodoc:
type_map
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR == 0
::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID::TYPE_MAP
else
type_map
end
end
end
end
Expand Down

0 comments on commit efe956d

Please sign in to comment.