-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Changelog
Engines no longer seed by default. The proper workflow to create an engine is now:
# Add engine to your Gemfile
rails g refinery:<your_engine>
rake db:migrate
rake db:seed
Settings are now customized in the config/initializers/refinery
directory, not in the admin back-end.
All settings inside your Refinery application are now kept inside config/initializers/refinery
. They're copied there when you generate your engine.
Now as an installable engine located here.
Now, use:
rails generate refinery:engine <model_name> field:type field:type field:type --engine=<engine_name>
Settings are no longer referred to as RefinerySetting
, but as Refinery::<Engine>.value
. For example, inside an engine named Portfolio
, you might refer to Refinery::Portfolio.approximate_ascii_for_i18n
.
Internally, they are handled inside engines in two separate files. First, default values are declared inside lib/refinery/<engine_name>/configuration.rb
Secondly, the file that is interpreted when generating the engine is kept inside lib/generators/refinery/<engine_name>/templates/config/initializers/<engine_name>.rb.erb
. You can see an example of the configuration file here, and you can see an example of the generator file here
Now Refinery::<Engine>::(Admin::)?(Model || Controller)
— for example, Refinery::Blog::Post
or Refinery::Blog::Admin::PostsController
.