The easiest solution would be to rename your fields with undescores to
follow Rails conventions.
If you need to stuff map easily, a substitution on ''-'' for
''_'' is easy
enough to handle in your processing code.
Robby
On Thu, May 29, 2008 at 7:50 AM, Ethan
<otterlei-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> I am getting warnings in my logs for updates to a table I created that
> has column names from an XML response file i get from Google Checkout
> notifications. I basically log the orders into a mimicked table.
> Column names examples are "total-refund-amount" and so on.
>
> Below are the warnings. Any ideas on how to supress this? my updates
> are working. But its a pain to scroll through logs when one order
> creates about 300kb of text regarding these warnings.
>
> Has anybody experienced this? found a work-around?
>
>
>
> Exception occurred during reader method compilation.
> Maybe total-refund-amount is not a valid Ruby identifier?
> compile error
> C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
> attribute_methods.rb:160: syntax error, unexpected ''-'',
expecting ''\n''
> or '';''
> def total-refund-amount;
missing_attribute(''total-refund-amount'',
> caller) unless
@attributes.has_key?(''total-refund-amount'');
> (v=@attributes[''total-refund-amount'']) &&
> ActiveRecord::ConnectionAdapters::MysqlColumn.value_to_decimal(v); end
> ^
> C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
> attribute_methods.rb:160: syntax error, unexpected kEND, expecting
> $end
> def total-refund-amount;
missing_attribute(''total-refund-amount'',
> caller) unless
@attributes.has_key?(''total-refund-amount'');
> (v=@attributes[''total-refund-amount'']) &&
> ActiveRecord::ConnectionAdapters::MysqlColumn.value_to_decimal(v); end
> ^
> Exception occurred during reader method compilation.
> Maybe total-refund-amount is not a valid Ruby identifier?
> compile error
> C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
> attribute_methods.rb:160: syntax error, unexpected ''-'',
expecting ''\n''
> or '';''
> def total-refund-amount=(new_value);write_attribute(''total-refund-
> amount'', new_value);end
> ^
> C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
> attribute_methods.rb:160: syntax error, unexpected kEND, expecting
> $end
> def total-refund-amount=(new_value);write_attribute(''total-refund-
> amount'', new_value);end
> ^
> Exception occurred during reader method compilation.
> Maybe total-refund-amount is not a valid Ruby identifier?
> compile error
> C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
> attribute_methods.rb:160: syntax error, unexpected ''-'',
expecting ''\n''
> or '';''
> def total-refund-amount?;
query_attribute(''total-refund-amount''); end
> ^
> C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
> attribute_methods.rb:160: syntax error, unexpected kEND, expecting
> $end
> def total-refund-amount?;
query_attribute(''total-refund-amount''); end
> ^
>
>
> thanks, Ethan
> >
>
--
Robby Russell
Founder and Executive Director
PLANET ARGON, LLC
Design, Development, and Hosting with Ruby on Rails
http://www.planetargon.com/
http://www.robbyonrails.com/
aim: planetargon
+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---