This project is archived and is in readonly mode.
'#' character in column name causes ActiveModel error
Reported by Brian Ploetz | October 15th, 2010 @ 10:33 PM | in 3.0.2
I have an Oracle table which has the following column (legal in Oracle):
CASE# VARCHAR2(20)
Note the '#' character. I have this table mapped to a model class via ActiveRecord. This column name causes the following error whenever you try to use this model:
Failures:
1) Case should be valid with valid attributes
Failure/Error: @case.save!
/Users/bploetz/.rvm/gems/ruby-1.9.2-p0@sw-model/gems/activemodel-3.0.0/lib/active_model/attribute_methods.rb:273: syntax error, unexpected keyword_undef, expecting ')'
undef :case#?
^
/Users/bploetz/.rvm/gems/ruby-1.9.2-p0@sw-model/gems/activemodel-3.0.0/lib/active_model/attribute_methods.rb:274: syntax error, unexpected keyword_end, expecting $end
This comes from the following in active_model/attribute_methods.rb:
if method_defined?(:#{method_name})
undef :#{method_name} end
These evaluate to :case#, which is not a valid symbol.
Comments and changes to this ticket
-
Ryan Bigg October 19th, 2010 @ 08:33 AM
- Tag cleared.
- Importance changed from to Low
Automatic cleanup of spam.
-
Robert Pankowecki October 24th, 2010 @ 09:47 AM
- Tag set to activemodel, columns
I will work on it.
-
Aditya Sanghi October 24th, 2010 @ 02:33 PM
- Milestone set to 3.0.2
Please provide a failing test and a patch as per the Contributor's guide.
-
Repository November 14th, 2010 @ 09:24 AM
- State changed from new to resolved
(from [88688cdd8e467d4bdebfa3f08e47cd5e7c5ead2c]) Fix when database column name has some symbolic characters. [#5818 state:resolved] https://github.com/rails/rails/commit/88688cdd8e467d4bdebfa3f08e47c...
-
Repository March 17th, 2011 @ 12:28 AM
(from [c75e4aeca398c1c48bf40ef24bd89067a87124fc]) Fix when database column name has some symbolic characters. [#5818 state:resolved] https://github.com/rails/rails/commit/c75e4aeca398c1c48bf40ef24bd89...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Tags
Referenced by
- 5818 '#' character in column name causes ActiveModel error (from [88688cdd8e467d4bdebfa3f08e47cd5e7c5ead2c]) Fix whe...
- 5818 '#' character in column name causes ActiveModel error (from [c75e4aeca398c1c48bf40ef24bd89067a87124fc]) Fix whe...