Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method sequence_separator= (NoMethodError) #678

Closed
januszm opened this issue Jun 23, 2015 · 2 comments
Closed

undefined method sequence_separator= (NoMethodError) #678

januszm opened this issue Jun 23, 2015 · 2 comments

Comments

@januszm
Copy link

januszm commented Jun 23, 2015

I keep getting this error whenever I try to set the deault configuration for the sequence_separator in the initialiser.

Here's the fragment of my initialiser, which is the default generated one:

FriendlyId.defaults do |config|
    # When FriendlyId can not generate a unique ID from your base method, it appends
    # a UUID, separated by a single dash. You can configure the character used as the
    # separator. If you're upgrading from FriendlyId 4, you may wish to replace this
    # with two dashes.
    #
    config.sequence_separator = '--'
    #

I've noticed that the attr_writer is present in the Slugged module in

module Configuration
  attr_writer :slug_column, :sequence_separator

But it is it the right place? Initialiser sets FriendlyId.defaults, there's no such writer in FriendlyId::Configuration or in Base module. Also, id doesn't work if I try to set it in defaults using

config.sequence_separator '--'

or

config[:sequence_separator] = '--'

This fragment should be removed from or updated in the default, generated initialiser, or a proper attr_writer should be added in right place.

@norman
Copy link
Owner

norman commented Jun 23, 2015

Please see #650.

@norman norman closed this as completed Jun 23, 2015
@initseis
Copy link

Check this solution: https://stackoverflow.com/a/30323207/23497576

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants