pluginaweek / preferences Goto Github PK
View Code? Open in Web Editor NEWAdds support for easily creating custom preferences for models
Home Page: http://www.pluginaweek.org
License: MIT License
Adds support for easily creating custom preferences for models
Home Page: http://www.pluginaweek.org
License: MIT License
sopwithpup opened this issue
trying to use in rails3.
added gem ’preferences’ to gemfile did bundle install seems to work
ran rails generate migration create_preferences,
edited to migration to create the table with timestamps
ran rake db:migrate
restated rails server
added some prefs to user model
all working
tried to access a pref using @user.prefers(:weekly_request)
got uninitialized constant Preferences::InstanceMethods::Preference
Am i missing something??
TIA
D
This ticket has 0 attachment(s).
When adding as a gem for rails 3.1.1
The problem is in class preferences.rb line 163, 164
change
named_scope with scope
trying to use in rails3.2.14
added gem ’preferences’ to gem file did bundle install seems to work
run the rails generate migration create_preferences,
edited to migration to create the table with timestamps
ran rake db:migrate
restarted rails server
added some prefs to user model
all working
tried to access a pref using @user.prefers_publish_profile
In user model i write like this
preference :publish_profile, :default => true
got uninitialized constant Preferences::InstanceMethods::Preference
Gravis opened this issue
If I have a float preference, the hash preferences don’t provide a float if the value was stored as a string.
Typically, rails will update preferences with strings instead of floats.
So, even if the type is a float, the preferences hash is incorrect :
{"my_float_pref"=> "1.1"}
When I get the pref using the standard preferred method, the value is casted correctly :
user.preferred(:my_float_pref)
=> 1.1
Thanks
This ticket has 0 attachment(s).
Erik Dahlstrand opened this issue
When going from 0.4.1 to 0.4.2 I get
@@@ ruby
.rvm/gems/ree-1.8.7-2010.01/gems/activesupport-2.3.5/lib/active_support/whiny_nil.rb:52:in method_missing’: undefined method
type_cast’ for nil:NilClass (NoMethodError)
.rvm/gems/ree-1.8.7-2010.01/gems/preferences-0.4.2/lib/preferences.rb:321:in preferences’ .rvm/gems/ree-1.8.7-2010.01/gems/activerecord-2.3.5/lib/active_record/base.rb:2197:in
inject’
.rvm/gems/ree-1.8.7-2010.01/gems/preferences-0.4.2/lib/preferences.rb:320:in each’ .rvm/gems/ree-1.8.7-2010.01/gems/preferences-0.4.2/lib/preferences.rb:320:in
inject’
.rvm/gems/ree-1.8.7-2010.01/gems/preferences-0.4.2/lib/preferences.rb:320:in `preferences’
@@@
when starting the web server.
This ticket has 0 attachment(s).
Sachin Sagar opened this issue
Hi,
I’ve implemented this plugin successfully and its working.
I went through all the README and lib files but couldn’t find the solution.
The problem is, how to get all the users based upon the preference name.
e.g.
@@@
I have added following in my user model:
preference :article_notification, :default => true
preference :post_notification, :default => true
@@@
Now how do I get all the users based upon the :article_notification preference?
This ticket has 0 attachment(s).
The method 'class_inheritable_class' has been deprecated on Rails 3.2.2 in favor of 'class_attribute'.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.