similar to: Bug with serialized columns in console ?

Displaying 20 results from an estimated 900 matches similar to: "Bug with serialized columns in console ?"

2007 Feb 18
2
SerializationTypeMismatch in Production Mode
In production mode, I keep getting this error the 2nd time it loads a page with a serialized attribute: ActiveRecord::SerializationTypeMismatch (answers_container was supposed to be a Array, but was a NilClass): /vendor/rails/activerecord/lib/active_record/base.rb:1964:in `unserialize_attribute'' In development, it works fine. In fact, if I set to false config.cache_classes in
2006 May 20
1
acts_as_paranoid overrides ActiveRecord::Base??
Guys, I am trying to figure out what exactly does this line do at the end of "acts_as_paranoid" plugin? ActiveRecord::Base.send :include, Caboose::Acts::Paranoid::ActiveRecord My problem: I have some classes that I use acts_as_paranoid, and others with tagging support. Classes declared as taggable, throw error, which appears to be in the acts_as_paranoid version of the
2006 Mar 27
2
:through and STI
Hi, I''m trying to use :through and STI using the trunk version of Rails, but I get the following error see bottom of this msg[1] here are my classes. class Player < ActiveRecord::Base end class Ladder < ActiveRecord::Base has_many :subscriptions has_many :players, :through => :subscriptions end class SingleLadder < Ladder end class Subscription <
2008 Jul 31
2
Freeze field in active record
Hello, I have a freeze field in a table (that I can''t change). When I try to find a record in this table I have the exception : C:/DATA/InstantRails-2.0/ruby/lib/ruby/gems/1.8/gems/ activerecord-2.1.0/lib/active_record/attribute_methods.rb:104:in `instance_method_already_implemented?'' C:/DATA/InstantRails-2.0/ruby/lib/ruby/gems/1.8/gems/
2007 Aug 15
2
has_many :through ... What am I missing?
class Ladder < ActiveRecord::Base has_many :players has_many :users, :through => :players end class Player < ActiveRecord::Base belongs_to :users belongs_to :ladders end class User < ActiveRecord::Base has_many :players has_many :ladders, :through => :players end When I try the following code (on the console) I get an error: @ladder = Ladder.find(1) @ladder.users I
2006 Dec 22
2
Relating Namespaced Models
I am dealing with a large project. I use a lot of STI and therfore have a lot of models. I''d like to use namespaces to help organize my models but am having trouble getting started. I have a base model Term::Base located in /app/models/term/base.rb: class Term::Base < ActiveRecord::Base set_table_name "terms" end I have a non-namespaced client model: class Client <
2006 Apr 06
4
Record retrieval in Many-to-many using :through not working
Hello, I get an error while retrieving records from the following model structure. Tables foods - id, food foodallergies - food_id, symptom_id, a few other columns symptoms - id, symptom Models class Food < ActiveRecord::Base has_many :foodallergies has_many :symptoms, :through => :foodallergies end class Symptom < ActiveRecord::Base has_many :foodallergies has_many :foods,
2011 May 07
4
Activerecord::JDBCError: Invalid column number
Hi, I''m rather new to Ruby and RoR, so I do not really know whether this ist the right forum to place my question. For my first ''project'' I planned to create a simple online-viewer, which grabs data from an existing database and make them visible in a structured form via browsers. So I thought that could be the right beginner-project, because I have only read datasets
2008 Jun 24
2
wrong number of arguments (1 for 0) when using respond_to?
Trying to get an otherwise working app (in Rails 2.0.2) up to speed with Rails 2.1.0 and Ruby 1.8.7, I have some broken code I can''t seem to fix: module Pathmaker def self.append_features( base ) base.before_save do |model| model.path = model.name.downcase. gsub( /\ and\ /, ''-'' ). gsub( /\ on\ /, ''-'' ).
2010 Dec 08
0
ActiveRecord serialize field and SerializationTypeMismatch
Hello. In one of my ActiveRecord models I specified a a serialize field: serialize :settings MyModelSettings If I understand the documentation correctly this restricts settings to the class MyModelSettings. The problem is that this is so restrictive that I even don''t know how to initialize the field. MyModel.new or even MyModel.new(:settings => MyModelSettings) everything I do
2009 May 18
0
ActiveRecord SerializationTypeMismatch MySQL SQLite
I was having this error in Development but not in Test: ActiveRecord::SerializationTypeMismatch: cambiable_attributes was supposed to be a Hash, but was a String Which was the problem? I was using MySQL in Development and SQLite3 in Test. Field ''cambiable_attributes'' was type String in the DB schema and had to be type Text. I changed the data type to Text and it worked well in
2013 Nov 09
1
ActiveRecord return normal?
Hi Everyone, I''m totally brand new to RoR. I''m really starting to love coding more now that I''ve found RoR. I have what might be a dumb question, but I''m curious to know this. Is it normal to get this result: In the Beginning Rails 4 book I''m following this step: irb(main):097:0> article.location = "Toronto, ON" Here''s
2008 Feb 22
2
ActiveRecord::DangerousAttributeError ???
Hi, For some reason, this harmless block of code in my application controller def index @wide = true end is causing this hideous error. I have read the error means that the error is raised when attribute has a name reserved by ActiveRecord. Does that mean that none of my models can have columns named "toggle"? Here is the error and framework trace:
2008 Dec 15
0
insecure: can't modify hash
A weird problem occurs (only on the prod server, not locally), when i try to register a new user with restful_authentication. Once in a while, i get the following error when trying to sign up as a new user: Insecure: can''t modify hash usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/attribute_methods.rb:309:in `delete''
2009 Feb 02
9
ActiveRecord Unexplainable SystemStackError - Only in WEBrick
This SystemStackError is driving me crazy. It only takes place when testing with WEBrick - I can''t reproduce it with any tests. It is caused by calling the "missing" id method (base.rb:2435) on my ActiveRecord class. WEBrick and my tests are running as the same user, with a `ulimit -s` of 10240. Plus the query works sometimes so I don''t think this matters.
2013 Nov 18
1
wrong number of arguements (1 for 0) on ActiveRecord::Base#send
So I''m not exactly using Rails, but just ActiveRecord. Though I felt this would be more appropriate in the Rails forum than the general Ruby forum. I''m working on an app that interacts with databases, without having a database of its own. I have a class called Modeller, and a Modeller#retrieve_model(name) method that takes a name, looks for a table matching that name, creates a
2008 Nov 19
3
Rails.cache and problem with model id?
I have the following: MODEL: def self.get_tag_cloud Rails.cache.fetch(''fetish_tag_cloud'', :expires_in => 1.hour) do find(:all, :conditions => [ "approved_for_tag_cloud = true"], :order => "LTRIM(name)") end end CONTROLLER: def index @fetishes = Fetish.get_tag_cloud end VIEW: .... <% @fetishes.each do |fetish| -%>
2007 Apr 18
0
catching frozen hashes
Hello I have been wrestling w/ the frozen hash problem in a script and I''m trying to catch this at the source where it crashes the program in flames. Unfortunately, when I look at the errors, the failure is way up in the active record ancestery chain. Here''s the first entries in the error output:
2000 Jun 16
0
Memory usage in reload_services()
Hello, we are in troubles with smbd processes which are rapidly growing in terms of memory usage. We did implement a mean that gives us ability to dynamically mount or unmount samba shares. I prepared a simple script which demonstrates this very closely. Script loops following operations: - touch samba config file to make it newer - send SIGHUP to smbd process (kill -1 <smbd_pid>) -
2010 Aug 22
7
Rails 3: Error saving an object with no useful information
Hey, I''m kinda desperate cause I''m getting an error and have no idea how to fix this since it doesn''t give me any information hinting where the problem is: irb(main):054:0> reload!;User.last.save! Reloading... NameError: undefined local variable or method `to_ary'' for #<User:0x4ed5d20> from