Created
January 14, 2009 00:49
-
-
Save TheNicholasNick/46716 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"@quote.brokerage_percent = 2.86" | |
#<Quote id=nil asset_cost=#<BigDecimal:2afb41396bd0,'0.7E5',9(18)> asset_age=0 term=60 product_id="CON0" product_name="Consumer Loan" gst_dollar=#<BigDecimal:2afb41396a90,'0.0',9(9)> residual_percent=#<BigDecimal:2afb41397238,'0.0',9(9)> residual_dollar=#<BigDecimal:2afb413970f8,'0.0',9(9)> brokerage_percent=#<BigDecimal:2afb413904b0,'0.2857142857 1428571428 5714285714 2857142857 1428571428 5714285714 2857142857 143E1',81(90)> brokerage_dollar=#<BigDecimal:2afb41396900,'0.2E4',9(18)> brokerage_split1_dollar=nil brokerage_split2_dollar=nil amount_financed=#<BigDecimal:2afb4138f600,'0.72E5',9(27)> is_active=true created_at=nil updated_at=nil user_id=2> | |
#<BigDecimal:2afb413904b0,'0.2857142857 1428571428 5714285714 2857142857 1428571428 5714285714 2857142857 143E1',81(90)> | |
#<DataMapper::Validate::ValidationErrors:0x2afb41397670 @errors={:brokerage_percent=>["Brokerage percent must be a number"]}> | |
#<Quote id=nil asset_cost=#<BigDecimal:2afb41396bd0,'0.7E5',9(18)> asset_age=0 term=60 product_id="CON0" product_name="Consumer Loan" gst_dollar=#<BigDecimal:2afb41396a90,'0.0',9(9)> residual_percent=#<BigDecimal:2afb41397238,'0.0',9(9)> residual_dollar=#<BigDecimal:2afb413970f8,'0.0',9(9)> brokerage_percent=#<BigDecimal:2afb413904b0,'0.2857142857 1428571428 5714285714 2857142857 1428571428 5714285714 2857142857 143E1',81(90)> brokerage_dollar=#<BigDecimal:2afb41396900,'0.2E4',9(18)> brokerage_split1_dollar=nil brokerage_split2_dollar=nil amount_financed=#<BigDecimal:2afb4138f600,'0.72E5',9(27)> is_active=true created_at=nil updated_at=nil user_id=2> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Quote | |
include DataMapper::Resource | |
property :brokerage_percent , BigDecimal, :scale => 2 , :precision => 5 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If i put @quote.brokerage_percent = BigDecimal("0") | |
right before the save - all is well | |
"@quote.brokerage_percent = 2.86" | |
#<Quote id=nil asset_cost=#<BigDecimal:2b88a1bc99e0,'0.7E5',9(18)> asset_age=0 term=60 product_id="CON0" product_name="Consumer Loan" gst_dollar=#<BigDecimal:2b88a1bc98a0,'0.0',9(9)> residual_percent=#<BigDecimal:2b88a1bca070,'0.0',9(9)> residual_dollar=#<BigDecimal:2b88a1bc9f08,'0.0',9(9)> brokerage_percent=#<BigDecimal:2b88a1bc3838,'0.2857142857 1428571428 5714285714 2857142857 1428571428 5714285714 2857142857 143E1',81(90)> brokerage_dollar=#<BigDecimal:2b88a1bc9710,'0.2E4',9(18)> brokerage_split1_dollar=nil brokerage_split2_dollar=nil amount_financed=#<BigDecimal:2b88a1bc24b0,'0.72E5',9(27)> is_active=true created_at=nil updated_at=nil user_id=2> | |
now @quote.brokerage_percent = BigDecimal("0") an result is saved | |
"@quote.brokerage_percent = 0.00" | |
#<Quote id=nil asset_cost=#<BigDecimal:2b88a1bc99e0,'0.7E5',9(18)> asset_age=0 term=60 product_id="CON0" product_name="Consumer Loan" gst_dollar=#<BigDecimal:2b88a1bc98a0,'0.0',9(9)> residual_percent=#<BigDecimal:2b88a1bca070,'0.0',9(9)> residual_dollar=#<BigDecimal:2b88a1bc9f08,'0.0',9(9)> brokerage_percent=#<BigDecimal:2b88a1b82860,'0.0',9(18)> brokerage_dollar=#<BigDecimal:2b88a1bc9710,'0.2E4',9(18)> brokerage_split1_dollar=nil brokerage_split2_dollar=nil amount_financed=#<BigDecimal:2b88a1bc24b0,'0.72E5',9(27)> is_active=true created_at=nil updated_at=nil user_id=2> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment