Displaying 4 results from an estimated 4 matches for "alias_attribute".
2011 May 07
4
Activerecord::JDBCError: Invalid column number
...JDBC-drivers are loaded correctly.
Now I made a model mandate_file.rb which contains
class MandateFile < ActiveRecord::Base
# fix non-standard table and primary key name conventions
set_table_name "STAMM"
set_primary_key :D_LFDNR
# fix the upper-cased named columns
alias_attribute :id, :D_LFDNR
alias_attribute :annotext_az, :D_AZ
alias_attribute :name_creditor, :D_RUBGE
end
When I try to create a simple object via the console using "m =
MandateFile.new" I get the following list of errors:
ActiveRecord::JDBCError: Invalid column number
from arjdbc/jdb...
2007 Oct 16
2
Where override model attribute names?
OK, so I get that ActiveRecord determines model attributes through
reflection of the table schema. Handy for many cases, but not mine.
I need to override that and provide my own mapping of attribute names
to column names to use the mapped names throughout the application code.
I''ve been poking around looking for where in AR''s hierarchy I can can
inject this mapping, but
2006 Mar 14
5
Column aliasing in ActiveRecord?
Anybody know of a way to alias a column in ActiveRecord such that you
could reference it via a different symbol in your view for view
purposes?
Like my column is named X but I want to display it as Y and maybe I have
an accessor named Y set up on the model so that when I "call" Y from the
view (and controller?) I''m actually manipulating the column X?
Hope that makes sense.
2012 Sep 22
4
Class, Module, Object
>> reload!
Reloading...
=> true
>> puts Class < Module
true
=> nil
>> puts Module < Class
false
=> nil
>> puts Module < Object
true
=> nil
>> puts Object < Module
false
=> nil
>> Object.parent
=> Object
The above indicates that the Class object instance inherits from the
Module object instance and the Module object instance