Check out my new work – yesokservices.com

Yes OK Services, is a new service provider based out of Thiruvananthapuram, Kerala, India.

They offer :

  • Construction services
  • Mechanical Electrical and Plumbing services
  • Housemaid services
  • Chauffeur services
  • Security services
  • Home nurse services

They are quickly expanding their portfolio and offer opportunity for professionals who lost their jobs during the COVID-19 lockdown.

Visit them at http://yesokservices.com

Uninitialized constant User::Leafe

Hi guys,

I was writing a ruby on rails app and while doing the test cases, I came across a situation where the test cases failed with an error

uninitialized constant User::Leafe

Now, there is no typo in my code. I have a User model and a User can have many Leaves. So I had added associations to the rails User model.

has_many :leaves, :dependent => :destroy

While searching around Stackoverflow, I found this solution here

It details that Inflections in rails assumes that singular form of “leaves” is “leaf”. It also detailed the solution as adding an irregular inflection to the inflection initialisers to solve this.

So, add the following to the file, config/initializers/inflections.rb

ActiveSupport::Inflector.inflections do |inflect|
   inflect.irregular 'opening_leave', 'opening_leaves'
end

This fixed the problem. It is weird that Ruby on Rails does this, but more digging lead me to a documentation page here

This states that due to the fact that legacy applications may still use errant inflections, new patches that fixes errors in conversions done by the “inflector” in rails are not being done. For every error we observe, we have to provide the correct inflection rule in our ruby on rails app.

 

Homeplus Design Studio

Hey guys, Check out www.homeplusstudio.com

Homeplus Design Studio is an architectural firm which has a track record of great projects in and around the city of Thiruvananthapuram. Homeplus has done multiple projects ranging from houses to schools.

They offer turnkey services of building design, construction, Interior design, modular kitchens, CCTV Surveillance systems and Home security and automation systems as well. Check them out www.homeplusstudio.com.

ACPAD

Check out www.acpad.com

This is for a product ACPAD, which is the brainchild of the German Musician, Robin Sukroso. The product was developed in IIT Bombay, India, by a group of four engineers.

Design a site like this with WordPress.com
Get started