Sailias / bitcoin_payable

A rails bitcoin payment processing gem
MIT License
121 stars 31 forks source link

Nomethod Error with state_machine #19

Closed starcharles closed 6 years ago

starcharles commented 6 years ago

I got an error related to gem 'state_machine'.

NoMethodError - protected method `around_validation' called for #<StateMachine::Machine:0x007fd4ea002c80>:

Then , it is needed to add lines to change public method by overriding protected 'around_validation'.

config/initializers/bitcoin_payable.rb

BitcoinPayable.config.currency = :cad
BitcoinPayable.config.node_path = "m/0/"
BitcoinPayable.config.master_public_key = ENV["MASTER_PUBLIC_KEY"]
BitcoinPayable.config.testnet = true
BitcoinPayable.config.adapter = "blockchain_info"

# This should be added in README.md
module StateMachine::Integrations::ActiveModel
  public :around_validation
end
Sailias commented 6 years ago

@starcharles this was referenced in https://github.com/Sailias/bitcoin_payable/issues/7 but you're right, I should probably add it in as it's a requirement for the application to work.

I'll review your pull request.

Sailias commented 6 years ago

fixed with AASM implementation