You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com
Hey everyone,
I am working on a project which among other things involves a legacy database schema that does not follow rails conventions. In an attempt to try and hide this fact I've taken to aliasing all attributes to what they would have been called if built in Rails from the beginning. One place where this doesn't work however is for foreign keys in associations. My longterm goal is being abel to change the database schema and only removing the aliases.
As an example
classPost<ActiveRecord::Base alias_attribute :user_id :userId # For the foreign_key it's not possible to use the aliased value `user_id` belongs_to :user, foreign_key::userId end
Is this a deliberate decision or just something that has happend naturally and never been brought up? If it's something that you would be willing to accept a PR for I would love to give it a shot.