I'm trying to implement the Plutus Gem with my Rails 4 Application. The documentation seems to be quit thorough and I've been able to successfully install the gem and creat my accounts using seeds.rb:
Plutus::Asset.create(:name => "Principal")
Plutus::Equity.create(:name => "Principal Capital")
My code for creating a new entry looks like this:
entry = Plutus::Entry.build(
:description => "New Entry",
:debits => [
{:account => "Principal", :amount => 100}],
:credits => [
{:account => "Principal Capital", :amount => 100}]
)
When trying to create a new entry, I am faced with this error message: "undefined method `find_by_name' for #"
I have copied the code used in the documentation to try and create this entry, so I was not expecting this a all.
UPDATE:
I have tested further, and when I add the new entry code in my seeds.rb file, the record is created perfectly. Just need to get it working from my controller.
Could anybody please assist?
Thanks.