Assign a default value to an attribute in Active Record - Andy Croll

If you ever needed to set a default value in an instance of an Active Record model, you probably used a callback.Since Rails 5.0 there’s been a better way. I had missed it until recently! (Thanks Moses!).
Assign a default value to an attribute in Active Record - Andy Croll #ruby #rubydeveloper #rubyonrails #active #record https://rubyonrails.ba/single/assign-a-default-value-to-an-attribute-in-active-record-andy-croll

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles