CARVIEW |
binarylogic / settingslogic
- Source
- Commits
- Network (6)
- Issues (5)
- Downloads (5)
- Wiki (1)
- Graphs
-
Branch:
master
-
Hello,
I'd like to see an easy way to have default options, stored directly on the model (or maybe optionally on another config file).
After a quick glance on the source code it seems to be doable by manually looking for the key (or calling method_missing ?), but I guess this would be a hack.
Is there any plan to do this ?
Thanks !
Comments
-
Settings.something <-- Works for me
Settings.something.other <-- Doesn't work at allI am on Rails version 2.3.4 and get a NoMethodError on script/console from ActionController of all things! Really strange...
Comments
Please ignore this one. Unlike what the documentation suggests, I figured out the hard way that:
1. Config, Configuration as class names wreak havoc
2. You can't have a key called appAlso,
Instead of polluting the app/models directory; the RAILS_ROOT/lib is an ideal place for the Settings class.
-
....take I18n.locale into account. Seems to be tricky to setup now.
Comments
-
when trying to access a model method I get TypeError: can't convert Fixnum into String in Rails 2.3.5 (latest git branch 2-3-stable commit)
from /+++/vendor/rails/activesupport/lib/active_support/core_ext/string/output_safety.rb:25:in `add_without_safety' from /+++/vendor/rails/activesupport/lib/active_support/core_ext/string/output_safety.rb:25:in `+' from (erb):5
Comments