Module: ColumnPrefix
- Defined in:
- lib/column_prefix.rb,
lib/column_prefix/version.rb
Constant Summary collapse
- VERSION =
"0.0.1"
Instance Method Summary collapse
-
#column_prefix(prefix) ⇒ Object
Alias prefixed attributes.
Instance Method Details
#column_prefix(prefix) ⇒ Object
Alias prefixed attributes
6 7 8 9 10 11 12 13 |
# File 'lib/column_prefix.rb', line 6 def column_prefix(prefix) column_names.each do |name| new_name = name.sub(prefix, '') if !self.respond_to? new_name alias_attribute new_name.to_sym, name.to_sym end end end |