Sha256: be6a13c6bd0bc114f2dbc43ba97491bfc3f94a2fb7e943a233ea10c54492992e
Contents?: true
Size: 840 Bytes
Versions: 4
Compression:
Stored size: 840 Bytes
Contents
# DefaultValues initialize with default_values ## Installation Add this line to your application's Gemfile: gem 'ar_default_values' And then execute: $ bundle Or install it yourself as: $ gem install ar_default_values ## Usage you can specify default values with hash: ```ruby class Book < ActiveRecord::Base default_values rating: 'r18', type: 'comic' do t = Time.now { :released_at => t, :edition_updated_at => t } end end book = Book.new book.rating # => "r18" book.type # => "comic" book.title # => nil book.released_at == book.edition_updated_at # => true ``` ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
ar_default_values-0.5.1 | README.md |
ar_default_values-0.5.0 | README.md |
ar_default_values-0.4.0 | README.md |
ar_default_values-0.3.1 | README.md |