- DELETE config.whitelist_attributes
- DELETE config.mass_assignment_sanitizer
- DELETE config.active_record.auto_explain_threshold_in_seconds
- CHANGE config.serve_static_assets TO config.serve_static_files
- SET config.eager_load TO false (dev and test), true (production)
See the ruby upgrade guide for exact details
-
Remove
attr_accessible
statements in your models. The controller now specifies which attributes in theparams
array are 'permitted' to be updated. This also applies to the create action. -
Add the attributes as strong parameters in your controller
####Example Before
#app/models/person.rb
...
attr_accessible :name, :title
...
After
#app/controllers/people_controller.rb
def new
@person = Person.new(person_params)
....
def update
if @person.update(person_params)
etc
...
protected
def person_params
params.require(:person).permitted(:name, :title)
end
run rails generate refinery:cms --update
(this will run rake db:migrate and rake db:seed)
run rake acts_as_taggable_on_engine:install:migrations
Check your app for any Refinery files that you may have over-ridden. Compare them to the new Refinery files
- Do you still need to override them?
- Are there changes you need to include in your copy of the file?
- Is there another way of making your change without overriding? Presenters and Decorators offer better ways to change Refinery's default behaviour.
In application.rb DELETE
config.to_prepare do
Refinery.searchable_models = Refinery::Page
end
CREATE config/initializers/refinery/search.rb with an entry similar to the following
#config/initializers/refinery/search.rb
Refinery::Search.configure do |config|
config.enable_for = ['Refinery::Page']
end
The search route which was refinery.search_path
is now refinery.search_root_path
More information in refinerycms-search documentation
This is a great help @anitagraham, thank you. One thing to add (as I'm getting deprecation warnings) is to remove this from the engine.rb:
Also, for admin controllers of an extension, you may want to note that it just needs a
def person_params
(because crudify will call it)