Displaying 20 results from an estimated 10000 matches similar to: "Extend ActiveRecord::Base"
2007 Jan 10
3
ActiveRecord Error?
We spent a big chunk of yesterday hunting down a strange bug in one of
our rails apps and created a test project to try out different theories
on what was going on.  The result so far is a very small test case app
that perfectly reproduces the problem.  The question is, is there
anything *wrong* with what we''re doing here, or is it a problem with
ActiveRecord?  We''re on rails
2006 Aug 17
6
what did I do to my app? (Superclass mismatch?)
It was working before (as far as I can tell), but I freezed_edge and 
now...
The first time I load this page, it works fine, the second time I get 
the superclass mismatch, the third time (and any subsequent times ) i 
get undefined method.
I think this means my class is getting loaded twice?
my model looks like this:
class Quotation < ActiveRecord::Base
  has_many :price_breaks
  has_many
2006 Nov 17
5
[Tweaking-Typo-4.0.3] acts_as_ferret `method_missing''
Hey Folks,
after following the instructions for tweaking Typo to use rather ferret 
than DB queries to search article I got a strange NoMethod error when 
starting the console or the server scripts.
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:1129:in 
`method_missing'':NoMethodError: undefined method `acts_as_ferret'' for 
Content:Class
As you can
2006 Aug 16
6
Newbie-Question
Hi.
I''ve just started using Ruby on Rails.
Now I''ve got my first problem.
I generated a new migration ''add_price'' and get the message:
                                                                                                                                                                                                                             
2006 Nov 27
1
rails environment loaded but one plugin is undefined (using backgroundrb 0.2.0)
Hello all,
I''m using BackgroundRb 0.2.0 (standalone) and in the do_work method of
my worker, I''m working with objects from my Rails application. So in my
config/backgroundrb.yml file, I added this line:
    :load_rails: true
I think my worker isn''t doing what I want him to do. So I opened the
console and read these error lines:
    # ruby script/backgroundrb console
2006 Sep 18
5
Undefined method "updated?"
I recently updated Rails to the latests version, and one of my existing
apps broke. More speficially, it can''t find the method "updated?" when
it is attempting to call it on one of my models.
The stack trace follows:
NoMethodError
undefined method `updated?'' for #<MyModel:0xc91d50>
2006 Oct 11
3
Basic Relationship Problem
I''m trying to do a basic relationship and it''s not working the way it
should. The data model is obviously a test database as the fields are
minimal.
In irb I do the following:
>> user = User.create(:name => "shawn")
=> #<User:0x259ceac @errors=#<ActiveRecord::Errors:0x259c3a8
@errors={}, @base=#<User:0x259ceac ...>>,
2006 Aug 08
2
Migrations broken on trunk?
Just got an odd error running migrations off of a new trunk today.  Is 
this my fault is there a bug right now?
> rake db:migrate --trace
(in /home/magneticworld)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `instantiate_observers'' for ActiveRecord::Base:Class
2006 Jul 07
2
Problem with GetText 1.6.0 - undefined method ''N_''
I''m just upgraded GetText from 1.4.0 to 1.6.0, and all my tests got broken.
I got this error:
ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/base.rb:1129:in
`method_missing'': undefined method `N_'' for User:Class (NoMethodError)
etc
My model user.rb has this line:
  validates_format_of :login, :with => /^[a-zA-Z0-9_]+$/, :message =>
2013 Mar 28
1
undefined method 'sanitize_limit' for #<ActiveRecord::Relation:0x2aaaad35d720>
I am trying to upgrate rails from 3.0 to 3.1, while updating rails version 
I am getting following error
rake aborted!
undefined method `sanitize_limit'' for 
#<ActiveRecord::Relation:0x2aaaad35d720>
/some_package/lib/ruby/gems/1.8/gems/activerecord-3.1.12/lib/active_record/relation.rb:460:in 
`method_missing''
2006 Dec 14
3
Problem with ActiveRecord and Associations
Hi,
I''m having what I believe to be a typecast problem with ActiveRecord and
Associations.  In the code below, I need to flag a contact record for
deletion if the contact doesn''t have any addresses or books records:
sql = "select id, delete_flag from contacts where id = #{params[:id]}"
contact = Contact.find_by_sql(sql)
if (contact[0].addresses.count +
2008 Jun 02
3
Undefined method `store_full_sti_class=' for ActiveRecord::Base:Class (NoMethodError)
Hi everyone,
I created a new demo app with ''rails demo'' and proceeded to try and
launch the server with ''ruby scripts/server''.
I get the following stack:
C:\railsProj\demo>ruby script/server
=> Booting Mongrel (use ''script/server webrick'' to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to
2006 Aug 17
4
Automatically creating associated records with after_create
Hi all.
I am actually using ActiveRecord outside of Rails but I don''t see that 
it matters for this question.
I want to automatically create a registration entry when I add a new 
user to my application. This works fine, but it''s not automatic:
class User < ActiveRecord :: Base
  has_many :registrations
end
class Test
  user = User.new
  user.registrations.create
end
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.
2006 Nov 04
0
ActiveRecord Observers and Model breakage.
I''m attempting to assign ActiveRecord Observers to some of my models,
specified in config/environment.rb like so,
config.active_record.observers = :presentation_observer,
:asset_observer, :tag_observer
My models use plugins which extend ActiveRecord::Base, including
Sebastian Kanthak''s file_column
Attempting to boot mongrel yields:
2009 Mar 24
12
MonkeyPatching ActiveRecord::Base class
I am trying to monkey-patch the ActiveRecord::Base class to incorporate
a generic search class method so that it can be used by all model
classes which need this functionality.  Since model classes directly
inherit from ActiveRecord::Base and unlike controllers and helpers, do
not have an ancestor class defined, I think I am forced to open the
ActiveRecord::Base class and patch it?  May be I am
2006 Aug 06
2
help with method_missing in ActiveRecord
I am serializing a data object (FooData) into an ActiveRecord column (Foo).
I''d like to be able to do delegate methods to the data class if the Foo
class doesn''t have that attribute. So instead of:
f = Foo.new
f.data.item1
I''d like to do:
f = Foo.new
f.item1
I was hoping that I could add a method_missing method to my Foo class and
call methods in the FooData class
2006 Aug 25
6
End-of-File Error occured at <except.c>:103 in xpop_context
Hi, I get this when searching or adding a new record. I am using today''s 
version of trunk and gem ferret 0.10.0
any ideas? thanks!
 EOFError in DvbesController#new
End-of-File Error occured at <except.c>:103 in xpop_context
Error occured in store.c:197 - is_refill
	current pos = 0, file length = 182
RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full
2007 Oct 24
7
NoMethodError when creating new ActiveRecord model object
the strangest thing is happening...i''m not getting this every time,
maybe 1/3 of the time, identical requests...
i''m a rails newbie, but i think i''m trying pretty standard stuff, this
is an excerpt from the log:
----------------------
Processing EmailConfigsController#edit_xml (for 127.0.0.1 at 2007-10-24
15:52:09) [GET]
  Session ID: 6630219819a2da423d8c48a259dd28d6
2006 Aug 15
2
has_many + finder_sql & :include
Hello,
In a model I have:
has_many :things, :finder_sql => '' select * from other_things '' +
                                 '' where id = #{id} ''
When I do MyClass.find(:all, :include => :things) I get a weird error:
 from 
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract_adapter.rb:120:in