I have added a module in rails concern to update two attributes with a default value.
But not able to do it. Could someone please explain it?
module DefaultValueForCreateAndUpdateUserid
extend ActiveSupport::Concern
before_save do
self.create_uid = 'x' if !self.create_uid?
self.last_updt_uid = 'x' if !self.last_updt_uid?
end
end
end
But it is giving this error:
NoMethodError: undefined method `before_save' for DummyValueForCreateAndUpdateUserid:Module