Displaying 20 results from an estimated 900 matches similar to: "Migrations, data loads and changes to the model"
2007 Jan 25
8
Mongrel with mephisto on a Virtual Private Server
Hello everyone,
I am trying to setup Mongrel to work with Apache on a VPS as part of a mephisto installation. Has anyone done this, and if so how did you edit your conf file to make it work?
I used the info found on the mongrel site at:
http://mongrel.rubyforge.org/docs/apache.html<http://mongrel.rubyforge.org/docs/apache.html>
and one time I did get a mephisto splash screen, but it was
2006 May 24
1
Observer behavior differences between DEV and TEST environments ?
Hi all !
I''m having an issue and I can''t seem to make heads or tails of it.
I am attempting to add an observer to a model object. I created
app/models/greenback_transaction_observer.rb, inherited from
AR::Observer, defined methods, registered in config/environment.rb,
but things don''t work...
So, I took a step back and put in the following code:
class
2006 Feb 08
8
Liquid with database?
Hello,
Just wondering if someone here as successfully ported Liquid to use with a database. I would like to try it out but not sure how Liquid integrates with current templates.
Thanks
Frank
---------------------------------
Yahoo! Mail - Helps protect you from nasty viruses.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2010 Jun 11
2
AR after_initialize quandry
I have a case where I am abstracting the creation of models. After a
fair bit of indirection, I eventually get around to making a .new call.
I need to be able to pass params to that .new call.
I know I can''t use def initialize() in an AR model (rather frustrating).
So, I have found some references to after_initialize, but that doesn''t
work either.
I see several threads on
2009 Jul 11
3
Migration in Multiple Database
hello to all
I been working on this from past few days.
.I am talking about separate migration for each one of the multiple
database that a single rails application has connection with.I know that
rails can work with multiple databases but what with migrations
for e.g
my main rails application has a connection to two databases
1> main_development
2> secondary_development
Know suppose i
2011 Feb 28
7
XCP - migration from xend
Hello there,
I have some issues regarding xend domU migration to XCP VM.
I try to migrate my old xend domU''s to my xen Could using the xva.py
script. All seems to work quite ok, the migration process doesn''t throw
any errors, i get a .xva file with a proper Size.
When importing that file, immidiately the VG and LV is created, and VM
properties are assigned correctly. But when
2006 Oct 27
5
Purpose of after_initialize in ActiveRecord?
All,
I have a quick question - is the purpose of implementing
after_initialize to allow custom attribute initialization for AR
descendants?
I have been overriding initialize whenever I require custom setup of my
model classes, like so:
def initialize(attributes = nil)
super
self.Status = ''G''
end
So I have a couple of questions:
1) Could I achieve the same
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 11
1
after_initialize and after_save
Hello,
I am still reading Agile Web Developer pdf, it says about
after_initialize and after_find. There is a Joe asks part when I read
that they are special, however I didn''t really get the idea, why they are.
On rubyonrails.org in the manual there is some sort description about
their speciality, however their full descriptions are missing.
What are the difference between
2007 Jun 16
1
extending activerecord base with after_initialize
hi,
i am having problems getting after_initialize for activerecord
subclasses. basically, i am trying to use the guid plugin by andy
singleton. i am having problems extending the class to the plugins i
installed, so i figured i will just apply this to all the models in my
project. i trled to add the following to my lib/ folder. my goal is
to extended the activerecord class so that it uses
2006 Jul 06
2
Custom init. of ActiveRecord objects - best practices
All,
I''m wanting to initialize an ActiveRecord object.
I understand that there is a method called after_initialize that appears
to get called right after the ActiveRecord object is instantiated.
Is after_initialize a Ruby thing or a Rails thing?
Where is after_initialize documented?
Can I pass parameters to it? If so, how?
I want to initialize the "belongs_to" attribute of
2007 Feb 26
2
Apache+mod_proxy_balancer+Mongrel+Mephisto, Apache kills CPU
Our Mephisto install kills Mongrels and causes Apache to pound the
CPU. This started when we moved to Apache+mod_proxy_balancer+Mongrel.
Here''s what we know:
The following things are working OK, except when used in the
combination listed above: mongrel, mongrel_rails, MySQL, Apache,
mod_proxy_balancer. We believe these are all OK because we moved five
other Rails apps to this
2010 Jan 12
1
Rails after_initialize block doesn't seem to be run in the backgroundrb context
Hi all,
Just had an interesting production failure while updating my Rails
application - a bunch of code previously in config/environment.rb was
put into config/initializers. That resulted in me having to wrap some
code in config/environments/production.rb into an after_initialize
do ... end block
When backgroundrb was run against that code, the setup done in that
after_initialize block
2008 Aug 24
2
config.after_initialize and development mode
Hi,
I''m using activemerchant and setting up a class variable using
config.after_initialize. It works great for the first request, but
then the variable is nil.
config.after_initialize do
ActiveMerchant::Billing::Base.mode = :test
OrderTransaction.gateway =
ActiveMerchant::Billing::PaypalGateway.new(...)
end
I''m assuming this is is due to the model reloading after each
2006 Oct 24
9
[WARN] Got 99% CPU?
Hey folks,
I ran into a few people at RubyConf who were having 99% CPU issues. Please contact me if you meet the following criteria:
1. You are running a production site.
2. You are experiencing 99% CPU errors.
3. This is frequent enough that you cannot manage it.
Thank you. Please contact me off-list about it.
--
Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu
http://www.zedshaw.com/
2006 Sep 26
12
resource_feeder feedback
Let me apologize in advance as this is a topic that I feel passionate
and opinionated about. If I''m coming on too strong, please forgive me.
=== Be opinionated===
My first piece of advice is simple: be opinionated. Change the method
name to simply <feed_for>. Have it default to doing the right thing.
Perhaps give an option to change the default feed format, but default to
2006 Jun 26
1
ActiveRecord, instance_eval, and PStore
I''m trying to add some per-object behaviors to objects descended from
ActiveRecord, by using after_initialize() and instance_eval(), like this:
def after_initialize
self.instance_eval(File.read(''customers/default.rb''))
end
(Ultimately the file path will be dynamic, this is just proof of concept.)
default.rb just contains a few method definitions like this one:
def
2006 May 10
2
Exploring ActiveRecord::Base#serialize
Hi
I was recently taught about the useful ActiveRecord::Base#serialize.
It''s very useful for persisting arbitrary objects through the regular
database. For example, say you want to store a Set of all the years a
Convention took place. You do:
class Convention < ActiveRecord::Base
serialize :years, Set
end
This effectively creates a Convention#years attribute, which is a set:
you
2007 Apr 26
0
Shouldn't this spec fail?
Shouldn''t the second spec fail? I''m trying to provide a default value in the
model (I''m well aware this is normally the job of the controller, but it
seems right to be the model in this case). Also, after_initialize doesn''t
seem to be the right way of doing this, but before_create or any of the
other things don''t make the first test pass.
specify
2007 May 06
0
Initializing a Scheduler
I have a need for a scheduler to run from inside of my rails
application. I am familiar with Java (J2EE) and new to Ruby. In Java I
would have used a framework called Quartz. I would have created a
servlet and in the init method started up the Quartz framework. I have
created a new Ruby class and called it StartCron.rb in the Components
folder of my Rails app. I have been playing with the