This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Felix (author)
Sat Aug 16 07:47:25 -0700 2008
| name | age | message | |
|---|---|---|---|
| |
LICENSE | Sat Aug 16 07:47:25 -0700 2008 | [Felix] |
| |
README | Sat Aug 16 06:22:45 -0700 2008 | [Felix] |
| |
Rakefile | Sat Aug 16 07:47:25 -0700 2008 | [Felix] |
| |
TODO | Sat Aug 16 07:47:25 -0700 2008 | [Felix] |
| |
lib/ | Sat Aug 16 07:47:25 -0700 2008 | [Felix] |
README
MerbSettings ============ Enable settings for your app or models Add the slice as a regular dependency dependency 'merb-settings' Create a model that will hold all settings. Include the following as a basis. No other includes are necessary. class Setting include MerbSettings::Adapter::DataMapper include MerbSettings::Adapter::DataMapper::DefaultModelSetup end This then enables you to do the following: Setting.foo = "test" Setting.bar = 9 Setting.foo #=> "test" Setting.foo = 9 Setting.foo #=> 9 To have settings that are scoped to a model include the following alongside all your other model code: class User include MerbSettings::ScopedMethods property :foo, .... setting :foo, 'text' setting :bar, 12 end Notice that you can also set defaults for some settings so that if they are called upon before they are set then you will get the default (this actually is not working yet :-) ) Other options: You can set up global defaults in the before_app_loads callback Merb::BootLoader.before_app_loads do Merb::Slices::config[:merb_settings][:foo] = 'test' Merb::Slices::config[:merb_settings][:bar] = 9 end ------------------------------------------------------------------------------




