mardi 12 mai 2015

I have a project totally an api one returning json response. I have an affiliation table associated with other information. All information in my tables is being fetched through rake task. Now the issue is, the project was running fine but not now when I run a rake task it gives an error in .get method as such

NoMethodError: undefined method `get' for #<Class:0xc3ba52c>
/home/munam/.rvm/gems/ruby-2.1.4/gems/activerecord-4.1.6/lib/active_record/dynamic_matchers.rb:26:in `method_missing'

Here I have used it :

@affiliation = Affiliation.get('my_key')

If I change this to

@affiliation = Affiliation.find_by_key('my_key')

It works fine. But unfortunately I do not have access rights to change in it. Moreover I do not understand why has that method stopped working just at a sudden.

I read about this over here: http://ift.tt/1F4flnf

Can I not make it work some other way: I really need this integration to work properly. I will be really thankful if someone helps.

Aucun commentaire:

Enregistrer un commentaire