1
HyperRecordのフロントエンドでHypertable dbを使用しています。私はそれに固定されたいくつかのバグがありました。しかし、今や移行は私を抱きしめてしまいます。これまでに移行すると、エラーが表示されます:レールによる問題の原因となる高性能な移行2.3.8
rake aborted!
undefined method `select_rows' for #<ActiveRecord::ConnectionAdapters::HypertableAdapter:0xb6f791c4>
.rvm/gems/[email protected]/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/database_statements.rb:27:in `select_values'
私はコードまたはレール上のruby actice_recordを調べます。それが示している。
# Returns an array of arrays containing the field values.
# Order is the same as that returned by +columns+.
def select_rows(sql, name = nil)
end
undef_method :select_rows
これらの機能は、初期化時に修正を加えて削除しようとしました。
module ActiveRecord
module ConnectionAdapters
class HypertableAdapter
def select_rows(sql, name = nil)
end
end
end
end
その後、エラーNil value occurred while accepting array or hash
が発生しました。それを修正するために私は修正コードに新しいメソッドを追加しました。
module ActiveRecord
module ConnectionAdapters
class HypertableAdapter
def select_rows(sql, name = nil)
end
def select_values(sql, name = nil)
result = select_rows(sql, name)
result.map { |v| v[0] } unless result.nil?
end
end
end
end
は、それはエラーで来た:
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.map
/.rvm/gems/[email protected]/gems/activerecord-2.3.8/lib/active_record/migration.rb:421:in `get_all_versions'
は、いずれかはそれで何が起こっているか、アイデアを持っていますか?
この修正プログラムは、移行アップとアクティブレコードモデルのために完璧に動作します。移行ロールバックのみが残っています。 –