<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>opensoul.org - acts_as_money Comments</title>
  <id>tag:opensoul.org,2010:/2006/11/13/acts_as_money/comments</id>
  <generator version="0.8.0" uri="http://mephistoblog.com">Mephisto Drax</generator>
  <link href="http://opensoul.org/2006/11/13/acts_as_money/comments.xml" rel="self" type="application/atom+xml"/>
  <link href="/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
  <updated>2010-04-26T16:05:10Z</updated>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Michael Gatto</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:21625</id>
    <published>2010-04-26T16:05:10Z</published>
    <updated>2010-04-26T16:05:10Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Michael Gatto</title>
<content type="html">&lt;p&gt;Hi Brandon,&lt;/p&gt;


	&lt;p&gt;I&#8217;m using the rails plugin 2.1 branch. It deploys fine but when I test the app I get this error: NoMethodError (undefined method `price=&#8217;. It seems as if the plugin is not altering activerecord&#8217;s behavior. I installed manually since my dev machine is Windows without git.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>stephen</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:21266</id>
    <published>2010-03-17T19:42:50Z</published>
    <updated>2010-03-17T19:42:50Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by stephen</title>
<content type="html">&lt;p&gt;hmmm&#8230;  I removed acts_as_money and added the require &#8216;money/rails&#8217;  (i had require &#8216;money&#8217;) before.  I also have config.gem &#8216;collectiveidea-money&#8217; listed in the environment.rb.  When I do a rake gems I see collectiveidea-money listed with an &#8220;R&#8221; status.  In my model I have&#8230;   money :secured, :cents =&amp;gt; :secured_in_cents, :currency =&amp;gt; &#8220;USD&#8221;   It still isn&#8217;t working though so I must have the syntax wrong.  The only difference now is that both the value of &#8220;secured&#8221; and &#8220;secured_in_cents&#8221; are both null now where before the value_as_cents was being set to 0.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Brandon Keepers</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:21265</id>
    <published>2010-03-17T18:46:28Z</published>
    <updated>2010-03-17T18:46:28Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Brandon Keepers</title>
<content type="html">&lt;p&gt;Hi stephen,&lt;/p&gt;


	&lt;p&gt;I have moved acts_as_money into the collectiveidea fork of the money gem.  You shouldn&#8217;t need to install the plugin separately now.  If you install our fork of the money gem as a plugin, it should Just Work™.  If you install it as a gem, you&#8217;ll need to require &#8216;money/rails&#8217;.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>stephen</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:21262</id>
    <published>2010-03-17T15:59:14Z</published>
    <updated>2010-03-17T15:59:14Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by stephen</title>
<content type="html">&lt;p&gt;trying to get acts_as_money working with little luck.   I have tried both the standard money gem, v2.2.0 and collectiveidea&#8217;s money gem and neither seem to function with acts_as_money.  Quick rundown of the problem&#8230;&lt;/p&gt;


	&lt;p&gt;1.  Install money gem and acts_as_money
2.  Create a new project and create a basic scaffold
3.  Specify one object in the model as money
4.  Restart server.
5.  New columns in DB for _as_cents
6.  Try to create new records using simple forms.&lt;/p&gt;


	&lt;p&gt;At this point the records are created and data is fed to the database for all fields &lt;span class=&quot;caps&quot;&gt;EXCEPT&lt;/span&gt; the object which has been specified as being money.  When I check the database both the original value is null and the value_as_cents is 0.  I must be doing something stupid but hey, we all do sometimes.  Iam running Rails 2.3.4.  Thanks,&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Rob Bazinet</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:13400</id>
    <published>2009-05-07T15:17:57Z</published>
    <updated>2009-05-07T15:17:57Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Rob Bazinet</title>
<content type="html">&lt;p&gt;No, I am getting an error when executing this line:&lt;/p&gt;


	&lt;p&gt;a.price.format(:no_cents)&lt;/p&gt;


	&lt;p&gt;Without the format(:no_cents) it works for but with the format I get the error:&lt;/p&gt;


	&lt;p&gt;undefined method `has_key?&#8217; for [:no_cents]:Array&lt;/p&gt;


	&lt;p&gt;Is this not an option people are using?  I have the 2.1 tag and it works fine w/o the format but I need to not show anything past the decimal point.&lt;/p&gt;


	&lt;p&gt;Thanks.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Brandon</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:13395</id>
    <published>2009-05-07T12:55:48Z</published>
    <updated>2009-05-07T12:55:48Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Brandon</title>
<content type="html">&lt;p&gt;Make sure you have the &lt;code&gt;rails-2.1&lt;/code&gt; tag checked out (and that you restarted your server after switching to it).  It doesn&#8217;t use the :converter option, which was added in Rails 2.2.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Rob Bazinet</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:13375</id>
    <published>2009-05-07T03:23:54Z</published>
    <updated>2009-05-07T03:23:54Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Rob Bazinet</title>
<content type="html">&lt;p&gt;Brandon,&lt;/p&gt;


	&lt;p&gt;I am getting the same error as Alexander above, where I get the message:&lt;/p&gt;


	&lt;p&gt;Unknown key(s): converter&lt;/p&gt;


	&lt;p&gt;I have Rails 2.1.2 (error originally started with Rails 2.1.0, thought I might upgrade to 2.1.2) and the Rails-2.1 tag of acts_as_money.  I am using the &#8220;standard&#8221; money gem not your forked version.&lt;/p&gt;


	&lt;p&gt;Any advice?  Any clue to what is happening would be great.&lt;/p&gt;


	&lt;p&gt;Thank you.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Alexander Mikhailian</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:10796</id>
    <published>2009-02-04T20:13:10Z</published>
    <updated>2009-02-04T20:13:10Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Alexander Mikhailian</title>
<content type="html">&lt;p&gt;Aha, it works. 60 seconds running and I have not issues with your fork of the money plugin, yet ;-)&lt;/p&gt;


	&lt;p&gt;Actually, the 2.1.0 version did not work for me on update of the money fields in the views, but this is already history, I suppose&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Brandon</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:10293</id>
    <published>2009-01-05T04:01:58Z</published>
    <updated>2009-01-05T04:01:58Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Brandon</title>
<content type="html">&lt;p&gt;Alexander,&lt;/p&gt;


	&lt;p&gt;Check out &lt;a href=&quot;http://github.com/collectiveidea/money/tree/master&quot;&gt;our fork of the money gem&lt;/a&gt;, which incorporates the functionality of this plugin.  Install the Rails 2.2 and RSpec gems and run &lt;code&gt;rake spec&lt;/code&gt;.  The tests pass for me.  Let me know if they don&#8217;t pass for you.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Alexander Mikhailian</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:10292</id>
    <published>2009-01-05T03:54:13Z</published>
    <updated>2009-01-05T03:54:13Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Alexander Mikhailian</title>
<content type="html">&lt;p&gt;Mea culpa, I just noticed that I did not test it with 2.1.0. Forgot to unfreeze.&lt;/p&gt;


	&lt;p&gt;Anyway, it is not working with 2.2.2 (the one that installs by default today with gem install rails).&lt;/p&gt;


	&lt;p&gt;P.S. Thanks for the lib, anyway. It is a nice hack. If only the money gem was not sucking so much&#8230;&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Brandon</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:10289</id>
    <published>2009-01-05T02:25:45Z</published>
    <updated>2009-01-05T02:25:45Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Brandon</title>
<content type="html">&lt;p&gt;Alexander,&lt;/p&gt;


	&lt;p&gt;The plugin should be compatible with edge and 2.2.  Use the &lt;a href=&quot;http://github.com/collectiveidea/acts_as_money/tree/rails-2.1&quot;&gt;rails-2.1 tag&lt;/a&gt; for 2.1 and prior.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Alexander Mikhailian</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:10287</id>
    <published>2009-01-04T22:33:00Z</published>
    <updated>2009-01-04T22:33:00Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Alexander Mikhailian</title>
<content type="html">&lt;p&gt;I just tried your &lt;em&gt;acts_as_money&lt;/em&gt; plugin with rails 2.2.2 and rails 2.1.0 and I get in both cases the following exception:&lt;/p&gt;


&lt;pre&gt;Unknown key(s): converter&lt;/pre&gt;

	&lt;p&gt;with the App Stacktrace&lt;/p&gt;


&lt;pre&gt;vendor/rails/activesupport/lib/active_support/core_ext/hash/keys.rb:47:in `assert_valid_keys'
vendor/plugins/composed_of_conversion/lib/aggregations.rb:136:in `composed_of'
vendor/plugins/acts_as_money/lib/acts_as_money.rb:21:in `money'
app/models/transfer.rb:7
app/controllers/clients_controller.rb:18:in `show'
&lt;/pre&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>nathaniel</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:5394</id>
    <published>2008-03-03T21:45:43Z</published>
    <updated>2008-03-03T21:45:43Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by nathaniel</title>
<content type="html">&lt;p&gt;I am having a hell of time with acts_as_money and rails 2.0.2.  Everytime I edit a record and click save, whatever price is in my price field gets two extra zeros.  I am forced to trim two zeros off of every price field everytime I open a record for editing, even if all I wanted to do was adjust a different field.&lt;/p&gt;


	&lt;p&gt;I have no idea why this is happening.  Has anyone had this sort of issue happen to them?&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Brandon</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:5332</id>
    <published>2008-02-21T03:49:03Z</published>
    <updated>2008-02-21T03:49:03Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Brandon</title>
<content type="html">&lt;p&gt;Srgt &lt;span class=&quot;caps&quot;&gt;PPD&lt;/span&gt;,&lt;/p&gt;


	&lt;p&gt;The &#8221;$&#8221; is coming from the money gem.  If you want the amount without it, you can just call &lt;code&gt;#to_s&lt;/code&gt; on the money object.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Srgt PPD</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:5327</id>
    <published>2008-02-20T10:37:13Z</published>
    <updated>2008-02-20T10:37:13Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Srgt PPD</title>
<content type="html">&lt;p&gt;How do you remove the dollar sign from the format method? I tried to delete it, but nothing happend. Search within the code of the plugin but couldn&#8217;t find any more &#8221;$&#8221; signs.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>JM</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:5023</id>
    <published>2008-01-15T19:16:07Z</published>
    <updated>2008-01-15T19:16:07Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by JM</title>
<content type="html">&lt;p&gt;I haven&#8217;t tried this myself&#8230; does this plugin work with Rails 2.0?&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Brandon</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:2891</id>
    <published>2007-05-07T14:16:41Z</published>
    <updated>2007-05-07T14:16:41Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Brandon</title>
<content type="html">&lt;p&gt;LBo,&lt;/p&gt;


	&lt;p&gt;There&#8217;s not exactly a way to do it with the acts_as_money plugin, but if you look at the source for the plugin, it&#8217;s very trivial.  Mainly, it makes use of a patch to &lt;code&gt;composed_of&lt;/code&gt;, which I have also &lt;a href=&quot;http://source.collectiveidea.com/public/rails/plugins/composed_of_conversion/&quot;&gt;packaged as a plugin&lt;/a&gt;.  In your situation, I would just install the &lt;code&gt;composed_of&lt;/code&gt; plugin patch, then do something like the following in your model:&lt;/p&gt;


&lt;pre&gt;
composed_of :price, :class_name =&amp;gt; 'Money',
    :mapping =&amp;gt; [%w(cents cents), %w(currency currency)] do |hash|
  Money.new(&quot;#{hash[:dollars]}.#{hash[:cents]}&quot;, hash[:currency])
end
&lt;/pre&gt;

	&lt;p&gt;And then in your views:&lt;/p&gt;


&lt;pre&gt;
text_field_tag 'mymodel[price][dollars]'
text_field_tag 'mymodel[price][cents]'
&lt;/pre&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>LBo</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:2889</id>
    <published>2007-05-06T22:19:11Z</published>
    <updated>2007-05-06T22:19:11Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by LBo</title>
<content type="html">&lt;p&gt;Hi Brandon,&lt;/p&gt;


	&lt;p&gt;My users have to fill in a price with two seperate input fields. One for a full amount and one for cents. Together it makes the whole price.&lt;/p&gt;


	&lt;p&gt;What would be the best way to take care of the separate formvalues in combination with this plugin?&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>John Ward</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:2521</id>
    <published>2007-03-17T06:49:03Z</published>
    <updated>2007-03-17T06:49:03Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by John Ward</title>
<content type="html">&lt;p&gt;Brandon, 
Thanks for the reply.&lt;/p&gt;


	&lt;p&gt;The reasons I was considering were as its been posted as a patch it will eventually end up in core rails.&lt;/p&gt;


	&lt;p&gt;John&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Brandon</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:2519</id>
    <published>2007-03-16T21:11:19Z</published>
    <updated>2007-03-16T21:11:19Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Brandon</title>
<content type="html">&lt;p&gt;John,&lt;/p&gt;


	&lt;p&gt;When I initially released it, acts_as_money actually didn&#8217;t use the aggregations patch. But the code was doing some ugly string eval stuff. It was only a couple lines, but ugly none-the-less.  I added the aggregations patch to demonstrate its usefulness (no one cared).&lt;/p&gt;


	&lt;p&gt;I ended up packaging the &lt;a href=&quot;http://source.collectiveidea.com/public/rails/plugins/composed_of_conversion&quot;&gt;patch as a plugin&lt;/a&gt;, so I could remove it from acts_as_money, but I&#8217;m guessing people would find it more annoying to have to install 2 plugins.
Unless it&#8217;s getting in the way, I think I&#8217;m going to leave it as is. Got any good reasons to remove it?&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>John Ward</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:2518</id>
    <published>2007-03-16T20:40:36Z</published>
    <updated>2007-03-16T20:40:36Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by John Ward</title>
<content type="html">&lt;p&gt;I think it would be a good idea to package the acts_as_money without the composed_of patch.&lt;/p&gt;


	&lt;p&gt;Had you considered that?&lt;/p&gt;


	&lt;p&gt;This is not a reflection on the quality or otherwise, just that it would appear separate from the money code.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Brandon Keepers</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:719</id>
    <published>2007-01-10T04:31:32Z</published>
    <updated>2007-01-10T04:31:32Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Brandon Keepers</title>
<content type="html">&lt;p&gt;Haig,&lt;/p&gt;


	&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;MIT&lt;/span&gt;.  I&#8217;ll add it to the code.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Haig Didizian</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:718</id>
    <published>2007-01-09T19:33:20Z</published>
    <updated>2007-01-09T19:33:20Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Haig Didizian</title>
<content type="html">&lt;p&gt;Brandon, can you tell us how you&#8217;ve licensed this plugin? I can&#8217;t seem to find anything in the code about it&#8230; Thanks!!&lt;/p&gt;</content>  </entry>
</feed>
