Skip to content

Commit

Permalink
some (irreleant) code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kares committed Jan 29, 2013
1 parent cf9fdd8 commit 6c7b686
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
14 changes: 8 additions & 6 deletions lib/arjdbc/derby/adapter.rb
Expand Up @@ -3,7 +3,7 @@
module ::ArJdbc
module Derby
def self.column_selector
[/derby/i, lambda {|cfg,col| col.extend(::ArJdbc::Derby::Column)}]
[ /derby/i, lambda { |cfg, column| column.extend(::ArJdbc::Derby::Column) } ]
end

def self.monkey_rails
Expand All @@ -14,12 +14,11 @@ def self.monkey_rails
# compare a CHAR value to a NUMBER column.
::ActiveRecord::Associations::ClassMethods.module_eval do
private

def select_limited_ids_list(options, join_dependency)
connection.select_all(
construct_finder_sql_for_association_limiting(options, join_dependency),
"#{name} Load IDs For Limited Eager Loading"
).collect { |row| connection.quote(row[primary_key], columns_hash[primary_key]) }.join(", ")
construct_finder_sql_for_association_limiting(options, join_dependency),
"#{name} Load IDs For Limited Eager Loading"
).collect { |row| connection.quote(row[primary_key], columns_hash[primary_key]) }.join(", ")
end
end

Expand Down Expand Up @@ -66,7 +65,10 @@ def adapter_name #:nodoc:

def self.arel2_visitors(config)
require 'arel/visitors/derby'
{}.tap {|v| %w(derby jdbcderby).each {|a| v[a] = ::Arel::Visitors::Derby } }
{
'derby' => ::Arel::Visitors::Derby,
'jdbcderby' => ::Arel::Visitors::Derby,
}
end

include ArJdbc::MissingFunctionalityHelper
Expand Down
9 changes: 3 additions & 6 deletions lib/arjdbc/jdbc/column.rb
Expand Up @@ -5,16 +5,13 @@ class JdbcColumn < Column

def initialize(config, name, default, *args)
call_discovered_column_callbacks(config)
super(name,default_value(default),*args)
super(name, default_value(default), *args)
init_column(name, default, *args)
end

def init_column(*args)
end
def init_column(*args); end

def default_value(val)
val
end
def default_value(value); value; end

protected

Expand Down

0 comments on commit 6c7b686

Please sign in to comment.