Displaying 20 results from an estimated 200000 matches similar to: "cattr_accessor"
2011 Sep 20
0
What's the difference between mattr_accessor and cattr_accessor in ActiveSupport?
Hi,
I was reading source code of mattr_accessor and cattr_accessor in
ActiveSupport and found out that the method definitions are all most
identical. Except cattr_writer accepts a optional block.
I googled and read
http://stackoverflow.com/questions/2203800/difference-between-mattr-accessor-and-cattr-accessor-in-activesupport.
That guy had the same question as me, but no one answered the question
2006 Mar 29
0
cattr_accessor missing for test of AR
Hello.
I''m trying to test an active record adapter. When launching :
ruby -I "connections\native_adaptername" anytest_test.rb
I have an method missing error, complaining about cattr_accessor
(missing from AR:Base).
Any advice ?
Tony
PS : ruby 1.9, rails 1.10 install via gems
--
Posted via http://www.ruby-forum.com/.
2012 Sep 09
2
mattr_accessor inside a class
Rails extends Ruby with mattr_accessor (Module accessor). As Ruby''s
attr_accessor generates getter/setter methods for instances,
mattr_accessor provide getter/setter methods at the module level. In
below example, you see that mattr_accessor declared in the class
context of LookupContext. It''s declared in class, not module. However,
modules are defined in LookupContext, for
2006 Sep 05
5
cattr_accessor
Hi,
i''ve been playing with ror for a little over two months now, and was
wondering wether someone could explain to me what was
cattr_accessor
and if it is still in use. . . i looked up in api.rubyonrails.com and
coulnd''t find any documentation...
is it a useful/worth learning method? what do u use it for?
--
Posted via http://www.ruby-forum.com/.
2013 Apr 08
1
cattr_accessor and Thread.current prblems
Hello,
I am trying to convert three applications to multitenant, all of them have
same structure difference is only in little functions and template designs.
All of them using cattr_accessor for setting currencies and other data, and
it works perfectly
Now i added app_id as cattr_accessor to App model to use it in
default_scope to implement multi-tenancy
class App < ActiveRecord::Base
2009 Apr 25
0
can run up the server after update to 2.3.2
my rails version was 2.2.2 and I turn 2.3.2 last night with gem update
and rake rails:freeze:edge. unfortunately I got a problem when I restart
my server.
a error when I script/server
./script/../config/../vendor/rails/railties/lib/rails/plugin.rb:1:in
`require'': no such file to load --
active_support/core_ext/kernel/reporting (LoadError)
from
2011 May 24
2
simple_form disable html5
Hello,
How do I disable html5 with simple_form gem?
I tried to type:
SimpleForm.html5 = false
in environment.rb
But this throws error.
undefined method `html5='' for SimpleForm:Module (NoMethodError)
Even though I see...
module SimpleForm
...
mattr_accessor :html5
@@html5 = true
...
end
Any explanation on this? How I can disable it in any other ways?
Thanks.
--
Posted via
2011 Feb 11
0
rails 3 initialize module, running cucumber
I have this in my environment file, I get "The error occurred while
evaluating nil.[] (NoMethodError)" on the S3Config.key= line when running
cucumber. Why is it not loading up the module when running cucumber?
module S3Config
mattr_accessor :key
mattr_accessor :sec
end
class ActiveRecord::Base
include S3Config
extend DynamicMethods
end
S3Config.key =
2011 Jul 11
2
Can't get this Rspec test to pass
Hello,
I''m completely new to Rspec testing and I''m finding it very difficult to
mock specific objects.
In this test, I have a before block setup as such:
[code]
before do
setup_controller_for_warden
controller.session[:operation_id] = 1
@operator = Factory :operator
sign_in :operator, @operator
@persist_herd = Herd.new
2006 Jul 05
2
Serialized object behaves weird
Hi!
I got a class named EinsatzFilter which I serialized to session. Before
saving to session it works afterwards I keep getting the message:
"undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from
ActiveRecord::Base inherited class.
Code:
class EinsatzFilter
include ApplicationHelper
attr_reader :personen, :monat, :projekte, :kunde
2007 Mar 05
1
ODBC Adapter woes
Hi All,
I am running into a little issue the ODBC adapter:
rails: 1.2
ruby: 1.8.4
ODBC ruby binding: .0997
Rails ODBC adapter: 1.4
I have added the ruby bindings to the /ruby/1.8/i386-msvcrt
and used gem to install the ODBC adapter
I updated the enviroment.rb
when I run
ruby -e ''require "odbc"'' it appears to correct (no error response)
1. Is my understanding
2006 Jul 01
3
best approach to add form elements dynamically
I am struggling with how to add dynamically add form elements to a form
based on user action. Now here is my situation:
I have model Project that has_many line_items
On the form to create a project I initially display form elements (some
drop downs and text boxes) for adding just one line_item. There is also
a button or a link on the page (not sure if this should be in the main
form or
2008 Sep 06
6
Configuring custom library
Hi,
I''ve added a custom library called lib\AccountSystem like so:
"module AccountSystem
SINGLE = 1
MULTIPLE = 2
class << self
attr_accessor :account_system_type
end
end"
Now I wanna configure
AccountSystem.account_system_type=AccountSystem::SINGLE in one app. I
used an initializer: config/initializers/account_initialization.rb
where I put this line in.
I
2006 Apr 06
7
LoginSystem : make @session available to models
Hello.
LoginSystem is cool, it populates the @session instance variable of
controllers with many useful info.
The fact is : it would be cool to let models know about the session,
too.
For instance, after_update and after_create callbacks could store *who*
did *what* on *what.
Aim : having ActiveRecord::Base::session defined, returning the @session
of the controller which manipulates the
2006 May 06
0
RE: Rails Digest, Vol 20, Issue 156
I am looking for a ruby hosting service. Can any one recommend one for me.
-----Original Message-----
From: rails-request@lists.rubyonrails.org [mailto:rails-request@lists.rubyonrails.org]
Sent: Saturday, May 06, 2006 7:37 AM
To: rails@lists.rubyonrails.org
Subject: Rails Digest, Vol 20, Issue 156
Send Rails mailing list submissions to
rails@lists.rubyonrails.org
To subscribe or
2005 Mar 01
0
SpeexEnc Launcher
Hi Tyler!
I found your e-mail in a forum and would like to ask you some questions if you don't mind.
I just learn about Speex last night and would like to know if works ok with VB. Since you have working with this in VB your could say something.
I intend to make a simple application to allow me to comunicate between to computers using VOIP and in each computer having a two-way
2006 Feb 02
4
rails-1.0.0 gem rdoc problem
Just got a brand new install of ruby-1.8.4 and new gems downloaded,
specifically rails-1.0.0. Seems rails does not generated rdoc for gem_server.
Looking into the problem, it seems that there is an error when doing ''rake rdoc''
for rails-1.0.0.
% rake rdoc
(in /opt/local/ruby-1.8.4/lib/ruby/gems/1.8/gems/rails-1.0.0)
rm -r doc
unrecognized option `--line-numbers --inline-source
2006 Mar 10
3
Changes to class caching between Rails 0.14.3 and 1.0?
Hi all,
We''re having a rather unique problem with class caching. We are
implementing the strategy pattern in the following manner:
1. Set an accessor for the class, let''s call it :strategy
class Widget
cattr_accessor :strategy
end
2. In environment.rb, we instantiate an object that implements the
strategy and use the accessor to set it for the class
strat =
2006 Aug 24
0
MacOS X: active_record module doesn't load
When I type
require ''active_record"
in IRB, I get this:
NoMethodError: undefined method `cattr_accessor'' for
ActiveRecord::Base:Class
from /usr/lib/ruby/site_ruby/1.8/active_record/base.rb:246
from
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require''
from
2007 Nov 11
1
Paypal Library - How to stop payments going to sandbox
I am using the Paypal Library for ruby
(http://dist.leetsoft.com/api/paypal/)
I have been testing it in development mode and the paypal sandbox site.
Now I have moved my application into production mode but the paypal url
still goes to the sandbox site:
https://www.sandbox.paypal.com/cgi-bin/webscr
How do I change the paypal URL?
--
Posted via http://www.ruby-forum.com/.