You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use activeuuid with rails 4.0.0. I have created migration according to example, then run it and got a error: "undefined method `adapter_name' for nil:NilClass".
Then I checke stacktrace and found next:
undefined method adapter_name' for nil:NilClass at /activeuuid-0.4.0/lib/activeuuid/patches.rb:11:inblock in uuid'
/activeuuid-0.4.0/lib/activeuuid/patches.rb:10:in each' /activeuuid-0.4.0/lib/activeuuid/patches.rb:10:inuuid'
When I opened patches.rb file I have found next row:
type = @base.adapter_name.downcase == 'postgresql' ? 'uuid' : 'binary(16)'
It seems like @base variable have not been initialized and I have no idea whre it from! Since I'm working with mysql, I just commented this row and inserted new one:
type = 'binary(16)'
But this is just a ugly hack, which should be fixed.
The text was updated successfully, but these errors were encountered:
So activerecord-4.0.0/lib/active_record/connection_adapters/abstract/schema_definitions.rb defines ActiveRecord::ConnectionAdapters::Table and ...::TableDefinition.
The problem is that Table does have a @base, but TableDefinition doesn't. At the bottom of activeuuid-0.4.0/lib/activeuuid/patches.rb we have:
Same method inclusion, different host class with differing interface. Table doesn't have a way to tell what database it's running under, so I'm not sure how to fix it.
The Postgres adapter has native UUID column support; it's perhaps useful to look to that for inspiration as to how to emulate it for the others, instead of monkey-patching Table and TableDefinition directly.
I'm trying to use activeuuid with rails 4.0.0. I have created migration according to example, then run it and got a error: "undefined method `adapter_name' for nil:NilClass".
Then I checke stacktrace and found next:
undefined method
adapter_name' for nil:NilClass at /activeuuid-0.4.0/lib/activeuuid/patches.rb:11:in
block in uuid'/activeuuid-0.4.0/lib/activeuuid/patches.rb:10:in
each' /activeuuid-0.4.0/lib/activeuuid/patches.rb:10:in
uuid'When I opened patches.rb file I have found next row:
type = @base.adapter_name.downcase == 'postgresql' ? 'uuid' : 'binary(16)'
It seems like @base variable have not been initialized and I have no idea whre it from! Since I'm working with mysql, I just commented this row and inserted new one:
type = 'binary(16)'
But this is just a ugly hack, which should be fixed.
The text was updated successfully, but these errors were encountered: