Browse files

Rearrange sections in README, add placeholder in CHANGELOG

  • Loading branch information...
1 parent 7bfd6b6 commit 34571717814bf7e1a9a63761418b6a1071f57296 @alup alup committed Feb 22, 2013
Showing with 25 additions and 23 deletions.
  1. +2 −0 CHANGELOG.md
  2. +23 −23 README.md
View
2 CHANGELOG.md
@@ -1,5 +1,7 @@
# Changelog
+## master
+
## 0.8.0
- Added defaults for amount and currency columns in database schema, based on the default currency.
- Use a better default subunit_unit name (choose the value of column.postfix set in the config).
View
46 README.md
@@ -44,29 +44,6 @@ configuration parameters for the rails app.
### ActiveRecord
-#### Migration helpers
-
-If you want to add money field to product model you may use ```add_money``` helper. That
-helper might be customized inside ```MoneyRails.configure``` block. You should customize
-```add_money``` helper to match the most common use case and utilize it across all migrations.
-
-```ruby
-class MonetizeProduct < ActiveRecord::Migration
- def change
- add_money :products, :price
-
- # OR
-
- change_table :products do |t|
- t.money :price
- end
- end
-end
-```
-
-```add_money``` helper is revertable, so you may use it inside ```change``` migrations.
-If you writing separate ```up``` and ```down``` methods, you may use ```remove_money``` helper.
-
#### Usage example
For example, we create a Product model which has an integer price_cents column
@@ -98,6 +75,29 @@ Now the model objects will have a ```discount``` attribute which
is a Money object, wrapping the value of ```discount_subunit``` column to a
Money instance.
+#### Migration helpers
+
+If you want to add money field to product model you may use ```add_money``` helper. That
+helper might be customized inside ```MoneyRails.configure``` block. You should customize
+```add_money``` helper to match the most common use case and utilize it across all migrations.
+
+```ruby
+class MonetizeProduct < ActiveRecord::Migration
+ def change
+ add_money :products, :price
+
+ # OR
+
+ change_table :products do |t|
+ t.money :price
+ end
+ end
+end
+```
+
+```add_money``` helper is revertable, so you may use it inside ```change``` migrations.
+If you writing separate ```up``` and ```down``` methods, you may use ```remove_money``` helper.
+
#### Allow nil values
If you want to allow the assignment of nil and/or blank values to a specific

0 comments on commit 3457171

Please sign in to comment.