When running bin/rails g solidus:install and selecting braintree as
the payment method, there is currently a failure during the running of
the db:seeds task that points to an issue with the table prefix not
taking effect
ActiveRecord::StatementInvalid: Could not find table 'solidus_braintree_configurations' (ActiveRecord::StatementInvalid)
After some extensive testing, it seems like this is a load order issue
in development (autoloading enabled) where the definition needs to
happen before the engine is declared. The previous location of this
method happens after the engine.rb require.
We attempted to move this to app/models/solidus_braintree.rb however
that did not work either as the autoloader did not load that file at
all, likely because the namespace is already defined elsewhere.
The cleanest solution here seems to be to declare the table name in each
model as there are only 3 currently in the extension, so we've opted for
that.
Summary
When running
bin/rails g solidus:install
and selectingbraintree
as the payment method, there is currently a failure during the running of thedb:seeds
task that points to an issue with the table prefix not taking effectwhich comes from the store decorator here
After some extensive testing, it seems like this is a load order issue in development (autoloading enabled) where the definition needs to happen before the engine is declared. The previous location of this method happens after the
engine.rb
require.We attempted to move this to
app/models/solidus_braintree.rb
however that did not work either as the autoloader did not load that file at all, likely because the namespace is already defined elsewhere.The cleanest solution here seems to be to declare the table name in each model as there are only 3 currently in the extension, so we've opted for that.
Steps to reproduce
rails new my_store
bundle add solidus
bin/rails g solidus:install
braintree
as the payment methodChecklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: