Forum: Ruby on Rails frozen? is defined by ActiveRecord

3218124dc039bf9afba426245deaaf13?d=identicon&s=25 Tsolmon Narantsogt (Guest)
on 2013-08-30 14:34
(Received via mailing list)
Hello folks


I got that error Pls tell me what's wrong

frozen? is defined by ActiveRecord
5f94b9b346c2aa648a80bc259978e5bc?d=identicon&s=25 Colin Law (Guest)
on 2013-08-30 14:38
(Received via mailing list)
On 30 August 2013 13:33, Tsolmon Narantsogt <mnts26@gmail.com> wrote:
> Hello folks
>
>
> I got that error Pls tell me what's wrong
>
> frozen? is defined by ActiveRecord

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
3218124dc039bf9afba426245deaaf13?d=identicon&s=25 Tsolmon Narantsogt (Guest)
on 2013-08-30 14:49
(Received via mailing list)
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
5f94b9b346c2aa648a80bc259978e5bc?d=identicon&s=25 Colin Law (Guest)
on 2013-08-30 15:25
(Received via mailing list)
On 30 August 2013 13:47, Tsolmon Narantsogt <mnts26@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
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.