Comments (8)
Sorry for my late response.
It might have been that the documentation of saved_change_to_attribute? was not clear. I would guess that in our case we were evaluating if an attribute was updated, but there was not any save method called yet. (in Rails 5.1+?)
I have changed with will_save_change_to_attribute - post.rb - and it seems to be working fine:
will_save_change_to_attribute?(:custom_url) || will_save_change_to_attribute?(:title)
Couldn't run tests and didn't had time to figure out how can setup al refinerycms in dev mode. If you have some documentation about what do I need setup in a dev env, I will be happy to contribute.
Best
Ionut
from refinerycms-blog.
I found some documentation around this: http://blog.toshima.ru/2017/04/06/saved-change-to-attribute.html which says that attribute_changed?
is deprecated and that saved_change_to_attribute?
is the new version.
We updated this in #480 as this version of Refinery specifically targets Rails 5.1.x
I wonder what could be going wrong?
from refinerycms-blog.
Hi Ionut, thank you! Does this guide help you? https://www.refinerycms.com/guides/contributing-to-refinery
from refinerycms-blog.
Yes, I should have seen it :)
I'll make a PR on this issue after I will have the dev + test mode running.
Best
Ionut
from refinerycms-blog.
Hi, this little change solved friendly URL me too.
saved_change_to_attribute?(:custom_url) || saved_change_to_attribute?(:title)
to
will_save_change_to_attribute?(:custom_url) || will_save_change_to_attribute?(:title)
from refinerycms-blog.
Hi @spotlessicode, could you provide a pull request with a test?
from refinerycms-blog.
Hi @bricesanchez I tried, but after several hours, I couldn't set forked and cloned refinerycms-blog in local.
from refinerycms-blog.
It doesn' work if you change something in the post, but not the title, it just goes back to the blog/post/1 url instead of the friendly one. So you have to add a space or something at the and of the title if you edit a post and save with that title changes. so better to use body as well:
will_save_change_to_attribute?(:custom_url) || will_save_change_to_attribute?(:title) || will_save_change_to_attribute?(:body)
from refinerycms-blog.
Related Issues (20)
- Error when trying to upgrade HOT 1
- 'refinery_settings' already exists HOT 2
- Compatibility with Rails 5.2 HOT 4
- Updating to jquery-ui v6 HOT 1
- Upgrading to version 4 resulted in list of authors to no longer be available from the Posts form
- Log production HOT 5
- Installation breaks base install of refinerycms HOT 8
- Bundle take too loog time to work. HOT 4
- refinerycms-wymeditor not work HOT 2
- Don't release the version >= 4.0.0
- Fix N + 1 for Refinery::Blog::Post.live HOT 5
- [Bug: feature/refinery-5] Can no visit the posts management page
- Travis CI fails with job exceeded max time limit HOT 1
- query-ui/widgets/autocomplete not found HOT 3
- Disable RSS Feed HOT 2
- Failing to install HOT 3
- uninitialized constant Refinery::Application (NameError)
- Dependabot can't resolve your Ruby dependency files
- is this gem still maintained?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from refinerycms-blog.