Is your plugin hosted on GitHub? Make sure to press the "fetch" button next to the repository field to fetch your plugin's info from GitHub rather than typing it all in.
Repository
Name
Home Page
Short description Sets up accessors returning a provided value for one or more fields. If the values of the fields aren't set upon saving the record, the fields are set to the default value provided.
Description = Default value plugin for Rails Sets up accessors returning a provided value for one or more fields. If the values of the fields aren't set upon saving the record, the fields are set to the default value provided. Fields may be given as an array of symbols referring to fields or a single symbol referring to a single field. Setting a field to nil has the effect of setting the field to its default value. For example: class Mixture < ActiveRecord::Base serialize :color default_value :color, [255, 0, 0] end m = Mixture.new m.color # => [255,0,0] another = Mixture.new(:color => [0,255,0]) another.color # => [0,255,0] another.color = nil another.color # => [255,0,0] And with multiple fields: class Something default_value [:foo, :bar], 1 end s = Something.new s.foo # => 1 s.bar # => 1 The value may also be a symbol or proc object. The result of calling the proc or the method referred to by the symbol is used as the value. class Genre < ActiveRecord::Base has_many :movies end class Movie < ActiveRecord::Base belongs_to :genre default_value :rating, Proc.new {|m| m.genre.default_rating } end sci_fi = Genre.create(:title => "Science Fiction", :default_rating => "PG-13") spaceballs = sci_fi.movies.create(:title => "Spaceballs") spaceballs.rating # => PG-13 (though it should actually be PG)
Description format RDoc MarkDown Textile
License Ruby's Rails' (MIT) GPL LGPL BSD Apache Artistic PublicDomain BSD-type Free-Trial Free-but-Restricted OpenSource Proprietary Shareware Source-available-proprietary Commercial
Category Assets Controllers Internationalization Misc. Enhancements Model Rails Engines Searching and Queries Security Statistics and Logs Testing View Extensions