I have been building a small app to import a cv from linkedin.
Displaying the information is working out perfect, but saving it to
the database is turning out to be a challenge.
The full source code is at https://github.com/brunoamaral/lwork and
the source code of the import function is as follows:
@user = User.find_by_username(params[:username])
client = LinkedIn::Client.new(@linkedin_apikey, @linkedin_secret)
t = current_user.authentications.find_by_provider(‘linked_in’)
@cv = client.profile(:fields =>
[:headline, :first_name, :last_name, :educations, :positions])
@user.positions << @cv.positions
When running it, I get the message:
undefined method `match’ for LinkedIn::Position::Resource:Class
The model adds the following to users:
has_many :positions, :class_name => LinkedIn::Position::Resource
What bugs me more is that I don’t even know where to start looking for
an answer to this, so any hints on where to search and what to look
for are welcome.