CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Sun, 03 Aug 2025 21:59:29 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20080725124218
location: https://web.archive.org/web/20080725124218/https://github.com/faithfulgeek/acts_as_currency/tree
server-timing: captures_list;dur=1.524276, exclusion.robots;dur=0.057022, exclusion.robots.policy;dur=0.035173, esindex;dur=0.020491, cdx.remote;dur=50.245118, LoadShardBlock;dur=562.489579, PetaboxLoader3.datanode;dur=369.664803, PetaboxLoader3.resolve;dur=156.939730
x-app-server: wwwb-app201
x-ts: 302
x-tr: 1051
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie: wb-p-SERVER=wwwb-app201; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Sun, 03 Aug 2025 21:59:30 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.6.31
x-archive-orig-date: Fri, 25 Jul 2008 19:42:18 GMT
x-archive-orig-transfer-encoding: chunked
x-archive-orig-connection: close
x-archive-orig-set-cookie: _github_sess=BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%250ASGFzaHsABjoKQHVzZWR7AA%253D%253D--4d8802a39cf2ae2680fcdf915bd7f8472555cf65; domain=.github.com; path=/
x-archive-orig-status: 200 OK
x-archive-orig-x-runtime: 0.38542
x-archive-orig-etag: "17ab91ab8e3bfd2796dc6447a77b3c73"
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-x_commoncrawl_parsesegmentid: 3912
x-archive-orig-x_commoncrawl_originalurl: https://github.com/faithfulgeek/acts_as_currency/tree
x-archive-orig-x_commoncrawl_urlfp: 7808715936188137135
x-archive-orig-x_commoncrawl_hostfp: -8801896244620822287
x-archive-orig-x_commoncrawl_signature: 17ab91ab8e3bfd2796dc6447a77b3c73
x-archive-orig-x_commoncrawl_crawlno: 1
x-archive-orig-x_commoncrawl_fetchtimestamp: 1217014938330
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
x-archive-orig-content-encoding: gzip
memento-datetime: Fri, 25 Jul 2008 12:42:18 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Tue, 17 Jun 2008 17:18:03 GMT", ; rel="prev memento"; datetime="Tue, 17 Jun 2008 17:18:03 GMT", ; rel="memento"; datetime="Fri, 25 Jul 2008 12:42:18 GMT", ; rel="last memento"; datetime="Fri, 25 Jul 2008 12:42:18 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 1217392648633_5-c/1217392872282_28.arc.gz
server-timing: captures_list;dur=0.587939, exclusion.robots;dur=0.024299, exclusion.robots.policy;dur=0.015179, esindex;dur=0.012400, cdx.remote;dur=303.104851, LoadShardBlock;dur=326.444134, PetaboxLoader3.datanode;dur=111.786577, PetaboxLoader3.resolve;dur=290.265065, load_resource;dur=144.131111
x-app-server: wwwb-app201
x-ts: 200
x-tr: 824
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
faithfulgeek's acts_as_currency at master — GitHub
This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (

This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (

Description: | Allows you to enter a '$' in fields stored as decimal but are actually currency types |
Homepage: | https://www.faithfulgeek.org/2008/3/26/acts_as_currency-released |
Clone URL: |
git://github.com/faithfulgeek/acts_as_currency.git
Give this clone URL to anyone.
git clone git://github.com/faithfulgeek/acts_as_currency.git
|
Search Repo: |

Joe Fiorini (author)
Tue Mar 25 23:43:06 -0700 2008
name | age | message | |
---|---|---|---|
![]() |
README | Tue Mar 25 23:43:06 -0700 2008 | Added readme file [Joe Fiorini] |
![]() |
init.rb | Tue Mar 25 23:41:53 -0700 2008 | Initial repository setup; adding required files. [Joe Fiorini] |
![]() |
lib/ | Tue Mar 25 23:41:53 -0700 2008 | Initial repository setup; adding required files. [Joe Fiorini] |
![]() |
spec/ | Tue Mar 25 23:41:53 -0700 2008 | Initial repository setup; adding required files. [Joe Fiorini] |
README
ActsAsCurrency ============== There's a problem in ActiveRecord. Let's say you have a field in a table that's supposed to be money, for example: add_column :products, :price, :decimal and you have an entry form on your website for admins to add products. Without even thinking, they will likely type the price with a dollar sign ('$'). If you follow the principal of least surprise, you will need to support this scenario. However, since ActiveRecord interprets the type as a decimal (since that's how it is in the database), you will get a silent fail in which all of your prices are 0! This is because all characters after the first non-number are interpreted as 0. That's where acts_as_currency comes in. Add it to your model and pass in any price fields, and they will all be able to take a '$'. Hope you enjoy! If you have any questions, please feel free to contact me at joe@faithfulgeek.org. Install ======= This project is hosted on github. There are a few options for installing it. #1 Using git-rails gem - This is by far the easiest method. Install git-rails by issuing: sudo gem install git-rails (Windows: gem install git-rails) git-rails install git://github.com/faithfulgeek/acts_as_currency.git #2 Using git-clone - This method requires that you have Git installed (might as well do it, it's a great alternative to svn) - Assumes your current working directory is your rails app root cd vendor/plugins git-clone git://github.com/faithfulgeek/acts_as_currency.git acts_as_currency #3 Source Tarball - If you cannot access Git at all, use this link https://github.com/faithfulgeek/acts_as_currency/tarball/master to download the source tarball cd vendor/plugins mkdir acts_as_currency && cd acts_as_currency tar xvcf faithfulgeek-acts-as-currency-master.tar.gz Troubles? Let me know! joe@faithfulgeek.org Example ======= class Product < ActiveRecord::Base acts_as_currency :price, :discount_price end For an example of the problem and how acts_as_currency solves it, please see specs/acts_as_currency_spec.rb. If you have rspec installed you can play around with different values and see how it all works. Copyright (c) 2008 Joe Fiorini, released under the MIT license
This feature is coming soon. Sit tight!