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

no need call valid? #3339

Merged
merged 1 commit into from
Jan 29, 2018
Merged

Conversation

ShallmentMo
Copy link

When we use refinerycms-pages, friendly_id, globalize, if we add validation which make it invalid to page, the valid? method will trigger set_slug of friendly_id one more time, and the set_slug method will use globalize.

This will be something like this:

globalize (5.1.0.beta2) lib/globalize/active_record/class_methods.rb:96:in `block in define_translated_attr_writer'
globalize (5.1.0.beta2) lib/globalize/active_record/adapter_dirty.rb:44:in `_reset_attribute'
globalize (5.1.0.beta2) lib/globalize/active_record/adapter_dirty.rb:16:in `write'
globalize (5.1.0.beta2) lib/globalize/active_record/instance_methods.rb:31:in `write_attribute'
globalize (5.1.0.beta2) lib/globalize/active_record/class_methods.rb:96:in `block in define_translated_attr_writer'
globalize (5.1.0.beta2) lib/globalize/active_record/adapter_dirty.rb:44:in `_reset_attribute'
globalize (5.1.0.beta2) lib/globalize/active_record/adapter_dirty.rb:16:in `write'
globalize (5.1.0.beta2) lib/globalize/active_record/instance_methods.rb:31:in `write_attribute'
globalize (5.1.0.beta2) lib/globalize/active_record/class_methods.rb:96:in `block in define_translated_attr_writer'
friendly_id (5.2.3) lib/friendly_id/slugged.rb:359:in `set_slug'

Finally, it will be SystemStackError (stack level too deep):

Copy link
Member

@parndt parndt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. Thanks!

@parndt parndt merged commit 7c38162 into refinery:master Jan 29, 2018
@ShallmentMo ShallmentMo deleted the no-need-check-valid branch January 29, 2018 04:04
@bricesanchez bricesanchez added this to the 4.0.2 milestone Mar 7, 2018
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

Successfully merging this pull request may close these issues.

3 participants