Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Message from discussion Possible DangerousAttributeError
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
darrin  
View profile  
 More options Feb 22 2008, 4:22 pm
From: darrin <darrin.ho...@gmail.com>
Date: Fri, 22 Feb 2008 13:22:52 -0800 (PST)
Local: Fri, Feb 22 2008 4:22 pm
Subject: Re: Possible DangerousAttributeError
How long have I been doing what, posing as a Rails guy? Been dabbling
in it for a year or two now.

As for your problem, try adding this to your model...

  class << self # Class methods
    alias :all_columns :columns

    def columns
      all_columns.reject {|c| c.name == 'hash'}
    end
  end

I didn't see any elegant way of aliasing table attributes, but this
hack will trick Rails into not trying to create accessor methods for
'hash'. If you ever need to get/set 'hash', you can use the
read_attribute/write_attribute methods directly.Good luck.

Darrin.

On Feb 22, 11:04 am, Brett Blackham <brett.black...@gmail.com> wrote:

> Darrin,
>  Have you been doing this a long time? I do have a hash attribute in
> the table. What can I do to get around this problem (Where should I
> look). I googled: 'ActiveRecord hash attribute database
> DangerousAttributeError' with no luck. Renaming the postgres DB
> attributes is not an option. Can I map the hash DB attribute to
> something else in my data model? :hash => :my_hash.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.