frozen? is defined by ActiveRecord

55 views
Skip to first unread message

Tsolmon Narantsogt

unread,
Aug 30, 2013, 8:33:21 AM8/30/13
to rubyonra...@googlegroups.com
Hello folks


I got that error Pls tell me what's wrong
frozen? is defined by ActiveRecord



Colin Law

unread,
Aug 30, 2013, 8:37:02 AM8/30/13
to rubyonra...@googlegroups.com
We are not telepathic so without knowing what you are doing it is
impossible to say. Post the full error and stack trace (if any) and
the section of code causing the problem. Not your whole app just a
few lines around the area where the problem occurs.

Colin

>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/CAPs6WSe4y1iYPihgdRSSFu4rYcsJdXEePKLFd8EaJ%3D3zTYqk_A%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Tsolmon Narantsogt

unread,
Aug 30, 2013, 8:47:56 AM8/30/13
to rubyonra...@googlegroups.com
I have to connect to an existing database.
But i got
ActiveRecord::DangerousAttributeError 
frozen? is defined by ActiveRecord

My code is here:
class Customer < ActiveRecord::Base
establish_connection :my_connection
self.table_name = 'customer'
self.primary_key = 'customer_no'
def self.get_all_customer
@
customer_data = Customer.find_by_sql("select customer_no from customer_table")
return @customer_data
end
end

Thanks


Colin Law

unread,
Aug 30, 2013, 9:23:54 AM8/30/13
to rubyonra...@googlegroups.com
On 30 August 2013 13:47, Tsolmon Narantsogt <mnt...@gmail.com> wrote:
> I have to connect to an existing database.
> But i got
>
> ActiveRecord::DangerousAttributeError
> frozen? is defined by ActiveRecord

Please don't top post, it makes it difficult to follow the thread.
Insert your reply inline in the previous post. Thanks.

Have you got a column in the db called frozen? If so then it is
warning you that the name conflicts with an ActiveRecord method.

Colin
> https://groups.google.com/d/msgid/rubyonrails-talk/CAPs6WScQTOAtNu9vvcVO%3Dmwf%3D5%2BJfwTKMpusWF_Z8BAHAuOJyA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages