I have the friendly_id initializer to shorten the value if there is a duplicate value in the database.
# over writing the conflict slug
module FriendlyId
module Slugged
def resolve_friendly_id_conflict(candidates)
candidates.first + friendly_id_config.sequence_separator + SecureRandom.hex(3)
end
end
end
Am using this in the Company Model as follows
extend FriendlyId
friendly_id :name, use: :slugged
Now if i leave the name
blank and test the validation i am getting the following error
NoMethodError at /members
undefined method `+' for nil:NilClass
Company#resolve_friendly_id_conflict
config/initializers/friendly_id.rb, line 5