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

Asset creation error #94

Closed
jonjonw opened this issue Jul 23, 2017 · 5 comments
Closed

Asset creation error #94

jonjonw opened this issue Jul 23, 2017 · 5 comments

Comments

@jonjonw
Copy link

jonjonw commented Jul 23, 2017

I'm getting an error when trying to create an asset.

`

Plutus::Asset.create(:name => "abcc")
NoMethodError: undefined method normal_credit_balance=' for #<Class:0x007f3bd26a98b0> from /home/jon/.rvm/gems/ruby-2.4.1@loantrack/gems/activerecord-5.1.2/lib/active_record/dynamic_matchers.rb:22:in method_missing'
from /home/jon/.rvm/gems/ruby-2.4.1@loantrack/gems/plutus-0.13/app/models/plutus/asset.rb:12:in <class:Asset>' from /home/jon/.rvm/gems/ruby-2.4.1@loantrack/gems/plutus-0.13/app/models/plutus/asset.rb:10:in module:Plutus'
from /home/jon/.rvm/gems/ruby-2.4.1@loantrack/gems/plutus-0.13/app/models/plutus/asset.rb:1:in <top (required)>' from /home/jon/.rvm/gems/ruby-2.4.1@loantrack/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:476:in load'
from /home/jon/.rvm/gems/ruby-2.4.1@loantrack/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:476:in block in load_file' from /home/jon/.rvm/gems/ruby-2.4.1@loantrack/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:661:in new_constants_in'
from /home/jon/.rvm/gems/ruby-2.4.1@loantrack/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:475:in load_file' from /home/jon/.rvm/gems/ruby-2.4.1@loantrack/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:374:in block in require_or_load'
from /home/jon/.rvm/gems/ruby-2.4.1@loantrack/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:36:in block in load_interlock' from /home/jon/.rvm/gems/ruby-2.4.1@loantrack/gems/activesupport-5.1.2/lib/active_support/dependencies/interlock.rb:12:in block in loading'
from /home/jon/.rvm/gems/ruby-2.4.1@loantrack/gems/activesupport-5.1.2/lib/active_support/concurrency/share_lock.rb:149:in exclusive' from /home/jon/.rvm/gems/ruby-2.4.1@loantrack/gems/activesupport-5.1.2/lib/active_support/dependencies/interlock.rb:11:in loading'
from /home/jon/.rvm/gems/ruby-2.4.1@loantrack/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:36:in load_interlock' from /home/jon/.rvm/gems/ruby-2.4.1@loantrack/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:357:in require_or_load'
from /home/jon/.rvm/gems/ruby-2.4.1@loantrack/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:510:in load_missing_constant' from /home/jon/.rvm/gems/ruby-2.4.1@loantrack/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:202:in const_missing'
from /home/jon/Projects/loantrack/loantrack/app/controllers/accounts_controller.rb:22:in create'

@cdmwebs
Copy link

cdmwebs commented Jul 30, 2017

@jonjonw do you have a local Rails model called Account?

@jonjonw
Copy link
Author

jonjonw commented Aug 4, 2017

I do, I was assuming the module / namespace would allow it.

@fabOnReact
Copy link

fabOnReact commented Jan 9, 2018

just read this post, thanks for the amazing project !

I had the same error by mokey patching the class Plutus::Account and solved it with the following code

class Plutus::Account < ActiveRecord::Base
   class_attribute :normal_credit_balance
end

@ace-subido
Copy link
Contributor

I've encountered this error since our local Rails app has a model called Account as well. I made a PR that resolved this for our end: #109

@mbulat
Copy link
Owner

mbulat commented Sep 25, 2020

This should be fixed in the latest commit. c26e2c2

@mbulat mbulat closed this as completed Sep 25, 2020
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

No branches or pull requests

5 participants