search for: mattr_accessor

Displaying 11 results from an estimated 11 matches for "mattr_accessor".

Did you mean: attr_accessor
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 mod...
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...
2011 Jul 11
2
Can't get this Rspec test to pass
...erd selected for ration.'') end end [/code] Here''s the catch - we have this groovy little plugin that globally enforces a model scope via a session id, in this case: session[:operation_id]. Here''s the code for the plugin: [code] module ApplicationScopeManager mattr_accessor :global_scope @@global_scope = [] mattr_accessor :local_scope @@local_scope = {} def self.included(base) base.send :extend, ClassMethods end def self.setup yield self end module ClassMethods def method_missing(name, *args, &block) return...
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 = AppConfig[''access_key_id''] S3Config.sec = AppConfig[''secret_access_key''] ActionMailer::Base.default_url_options[:host]=AppConfig[''base...
2006 Jan 05
0
cattr_accessor
Is this specific to rails? What''s it used for and when is it approriate to us it? Is there also a mattr_accessor? -- Posted via http://www.ruby-forum.com/.
2009 Apr 25
0
can run up the server after update to 2.3.2
..../script/../config/boot.rb:38:in `run'' from ./script/../config/boot.rb:11:in `boot!'' from ./script/../config/boot.rb:110 from script/server:2:in `require'' from script/server:2 and I tried to run rake rails:update, also a problem. rake aborted! undefined method `mattr_accessor'' for ActiveSupport::Dependencies:Module /home/ning/blank/Rakefile:4 Do you have any idea waht''s going wrong? -- Posted via http://www.ruby-forum.com/.
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 http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send e...
2011 Aug 07
1
get an arbitrary collection from gems?
Hi, I''m looking to do something though I''m not quite sure how to phrase it. What I''m looking to do is, essentially, make custom hooks using plugins/engines/gems. My use case is a member dashboard: I have a view partial for my site and a number of gems that I wrote installed. Each gem correlates to something a member can manage, like a photo gallery, their profile,
2012 Sep 22
4
Class, Module, Object
>> reload! Reloading... => true >> puts Class < Module true => nil >> puts Module < Class false => nil >> puts Module < Object true => nil >> puts Object < Module false => nil >> Object.parent => Object The above indicates that the Class object instance inherits from the Module object instance and the Module object instance
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
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