Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

make it rails 4 compatible #31

Closed
wants to merge 9 commits into from

4 participants

tubaxenor Bram de Vries dragosmiron Mose
tubaxenor

several fixes for making it compatible with rails 4 and rails 3.2.x :

  1. fix the deprecated warning when select_all is called.
  2. add select_values method
  3. let select_value and select_one take one more arguments.
dragosmiron dragosmiron commented on the diff
lib/active_record/connection_adapters/nulldb_adapter.rb
@@ -277,22 +277,30 @@ def delete(statement, name=nil, binds = [])
def select_all(statement, name=nil, binds = [])
with_entry_point(:select_all) do
- super(statement, name)
+ x = super(statement, name)

i would try and find a better variable name than x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Bram de Vries
Collaborator

Check #32 for a more complete implementation of AR4 support. This pull can be closed.

tubaxenor tubaxenor closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 21, 2013
  1. first try to fit rails 4

    xenor authored
  2. first try to fit rails 4

    xenor authored
  3. small tweaking

    xenor authored
  4. small tweaking

    xenor authored
  5. small tweaking

    xenor authored
  6. small tweaking

    xenor authored
Commits on Mar 25, 2013
  1. Mose
  2. tubaxenor

    Merge pull request #1 from mose/deprecation_kill

    tubaxenor authored
    avoiding a deprecation warning by some small cheat
Commits on Mar 26, 2013
  1. merge

    xenor authored
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 5 deletions.
  1. +13 −5 lib/active_record/connection_adapters/nulldb_adapter.rb
18 lib/active_record/connection_adapters/nulldb_adapter.rb
View
@@ -252,7 +252,7 @@ def select_rows(statement, name = nil)
[].tap do
self.execution_log << Statement.new(entry_point, statement)
end
- end
+ end
def insert(statement, name = nil, primary_key = nil, object_id = nil, sequence_name = nil, binds = [])
(object_id || next_unique_id).tap do
@@ -277,22 +277,30 @@ def delete(statement, name=nil, binds = [])
def select_all(statement, name=nil, binds = [])
with_entry_point(:select_all) do
- super(statement, name)
+ x = super(statement, name)

i would try and find a better variable name than x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ x.class.send(:define_method, :column_types) { [] }
+ x
end
end
- def select_one(statement, name=nil)
+ def select_one(statement, name=nil, binds = [])
with_entry_point(:select_one) do
- super(statement, name)
+ super(statement, name, binds = [])
end
end
- def select_value(statement, name=nil)
+ def select_values(statement, name=nil)
with_entry_point(:select_value) do
super(statement, name)
end
end
+ def select_value(statement, name=nil, binds = [])
+ with_entry_point(:select_value) do
+ super(statement, name, binds = [])
+ end
+ end
+
def primary_key(table_name)
columns(table_name).detect { |col| col.sql_type == :primary_key }.try(:name)
end
Something went wrong with that request. Please try again.