Displaying 20 results from an estimated 400 matches similar to: "config.after_initialize and development mode"
2007 Oct 13
4
Chapter 9
Hello,
I''m currently stunk on this issue for few days and I do not know how
to get it fixed.
The system always raises this error message :
order is closed
and here is my order.rb:
class Order < ActiveRecord::Base
include ActiveMerchant::Billing
before_validation :set_status
attr_protected :id, :customer_ip, :status, :error_message, :updated_at, :created_at
attr_accessor
2008 May 21
2
Replacing ActiveRecordStore::Session with a custom model
Has anyone managed to replace ActiveRecordStore::Session with their
own model?
In the source (http://dev.rubyonrails.org/browser/trunk/actionpack/lib/
action_controller/session/active_record_store.rb) it says you can
override the default by setting
CGI::Session::ActiveRecordStore.session_class = MySessionClass
I have tried doing this in a number of ways but I get all kinds of
weird errors, as
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
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
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
2011 Apr 08
5
How to extend a helper using plugin?
Hello,
I''m facing this problem while trying to extend the parse_redmine_links
helper method in Redmine-1.1.0 (Rails-2.3.5) from my plugin.
My idea is to use alias_method_chain so the extended version could
call the original version and adjust the result to it''s liking.
Anything I''ve tried so far exposes this behavior: the first render of
a page uses the extended
2006 Aug 08
2
Extending rails with plugins
I''ve been looking at bottling some functionality up into a plugin, but I''m
having some problems including it.
The structure I have is:
/app/controllers/admin/base_controller.rb:
class Admin::BaseController > ApplicationController
#snip#
end
/vendor/plugins/myplugin/lib/my_module.rb:
module MyModule
def new_func
"New Function"
end
end
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
2011 Apr 18
3
paypal with Active merchant
Hi, I am integrating paypal service in my application using Activemerchant.
Now I want to know how to use ActiveMerchant to make payment to Bank or
Credit card ?
for example:
I am seller and I want to pay some amount to somebody. I want to pay such
amount which will be credited in somebody''s bank account or credit card
directly ?
Please reply me as early as possible.
And also suggest
2006 Nov 20
1
Getting started with ActiveMerchant & new Ecommerce book
Hi there
I''ve got a copy of the ''Beginning Ruby on Rails Ecommerce'' book and am
trying to integrate ActiveMerchant into my app.
My order.rb file has the line:
''include ActiveMerchant::Billing''
per the book.
My Order model also has, amongst other things, the following validation:
'' validates_inclusion_of :billing_country, :in =>
2007 Feb 21
2
ActiveMerchant Help
Does anyone know of any good resources for getting ActiveMerchant up and
running? I''m trying to get it set up via Paypal Pro and i can''t find
detailed, clear directions on setting it up. It''s hard to know where to
put what, where paypal login info goes, and how to get the certificate
files from paypal and where they go (if I even need them).
Anyone have any experience
2006 May 30
2
ActiveMerchant
Is anyone using ActiveMerchant currently?
I''ve seen it recommended on this list several times, but it seems kind
of buggy and incomplete and I''m having trouble getting it to work.
>From the example at http://home.leetsoft.com/am/, I''ve tried:
gateway = ActiveMerchant::Base.gateway(:authorized_net)
response = gateway.capture(1000, creditcard)
..but it
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
2011 Feb 02
1
newbie: paypal + line items
hi,
using activemerchant + rails the first time. how can i send my line
items + descriptions etc over to paypal so that the user can review
the items?
purchase_options{
:items => [
{
:name => "Tickets",
:quantity => 22,
:description => "Tickets for 232323",
:amount => 1211221
},
2011 Apr 20
1
ActiveMerchant with Amazon's FPS
Hi, I want to integrate Amazon''s FPS service using Activemerchant.
I want to know that activemerchant support that?
and if yes, then can you please suggest any site to integrate Amazon''s FPS?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2006 Aug 09
7
function before_save
Hi everybody
I would like a function as the "before_save" method in the model. But it
must be the opposite. When I take out data from the database through the
model, I want to call a function before the data are available in the
controller.
Can anyone help me?
---- >>>> thx <<<< ----
--
Posted via http://www.ruby-forum.com/.
2009 Oct 23
1
Activemerchant
Hi All....
I have implemented activemerchant using gem.
I am using both STANDERD & EXPRESS checkout.
My EXPRESS works very well but when I use STANDERD one, paypal gives me
error like
"This transaction cannot be processed due to an invalid merchant
configuration".
Any idea whats going wrong???
Thanks in advance...
--
Posted via http://www.ruby-forum.com/.
2007 Jul 25
5
set_default_values rocket science - continuing after_initialize/after_find misfeature
Just starting a new thread so that it''s easy to follow.
I just submitted a patch at trac to add a new class method called
"set_default_values" ( not a great name I think ), which lets you do
all kinds of crazy stuff with setting default values.
This ticket is at http://dev.rubyonrails.org/ticket/9093 and example
pastie is at http://pastie.caboo.se/81925
It also lets you make
2006 Nov 01
1
Referencing a plugin in a spec
I am writing some specs that use ActiveMerchant to talk to a cc provider.
When I try to "include ActiveMerchant::Billing" in my spec, it tells
me it can''t find the plugin:
./activesupport/lib/active_support/dependencies.rb:123:in
`const_missing'': uninitialized constant ActiveMerchant (NameError)
Do I need to explicity require the main plugin file?
Thanks,
Mike Pence