I checked other questions also but couldn't fix this error:
I am calling my model class from a rake task.
authority_delegator.rake
namespace :authority_delegator do
desc "send delegation"
task delegator: :environment do
delegator = Delegator.new
end
end
deligation.rb
require 'csv'
class Delegator
@@file_path = "/Users/raj.sharma/Desktop/deligation.csv"
def read_csv
delegations = CSV.read(@@file_path)
end
end
error log
How to fix this error? Sorry I am new to rails.
Delegator
is a bad name for your class, don't use it, it's a built-in ruby class
.
provides three different ways to delegate method calls to an object.
Also the file of lib must have the same name as class/module in this file. Check this out Love Your lib Directory