Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly describe Account inheritance in Plutus models #109

Merged
merged 1 commit into from
Oct 31, 2019

Conversation

ace-subido
Copy link
Contributor

@ace-subido ace-subido commented Jul 13, 2018

Environment:

  • Rails App: 5.1.6
  • Rails App Ruby Version: 2.5.1
  • Plutus: 0.13

Travis reported an error when running tests for an application we've developed:

$ bundle exec rake db:create db:test:prepare
Created database '<redacted>_test'
rake aborted!
NoMethodError: undefined method `normal_credit_balance=' for #<Class:0x00000000093ada78>
/home/travis/build/bloom-solutions/<redacted>/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6/lib/active_record/dynamic_matchers.rb:22:in `method_missing'
/home/travis/build/bloom-solutions/<redacted>/vendor/bundle/ruby/2.5.0/gems/attr_encrypted-3.1.0/lib/attr_encrypted.rb:306:in `method_missing'
/home/travis/build/bloom-solutions/<redacted>/vendor/bundle/ruby/2.5.0/gems/attr_encrypted-3.1.0/lib/attr_encrypted/adapters/active_record.rb:131:in `method_missing_with_attr_encrypted'
/home/travis/build/bloom-solutions/<redacted>/vendor/bundle/ruby/2.5.0/gems/plutus-0.13/app/models/plutus/expense.rb:12:in `<class:Expense>'
/home/travis/build/bloom-solutions/<redacted>/vendor/bundle/ruby/2.5.0/gems/plutus-0.13/app/models/plutus/expense.rb:10:in `<module:Plutus>'
/home/travis/build/bloom-solutions/<redacted>/vendor/bundle/ruby/2.5.0/gems/plutus-0.13/app/models/plutus/expense.rb:1:in `<top (required)>'
...

A hypothesis was because the parent app has an unnamespaced Account model. This error seems similar to the one outlined here #94

Since our parent app has an Account model, it's colliding with the usage of Plutus::Account when it's being inherited by Expense, Liability, etc.

After making the change in this commit, the tests have passed for our Rails application

@ace-subido ace-subido mentioned this pull request Jul 13, 2018
@coveralls
Copy link

coveralls commented Jul 13, 2018

Coverage Status

Coverage remained the same at 94.523% when pulling 26ecb0e on bloom-solutions:avoid_account_name_collision into 00a98af on mbulat:master.

@mbulat mbulat merged commit 0ddae62 into mbulat:master Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants