search for: cattr_writ

Displaying 6 results from an estimated 6 matches for "cattr_writ".

Did you mean: cattr_writer
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 May 05
1
class_eval in ROR''s attribure_accessor.rb
hi, here is a snippet code in ROR''s attribure_accessor.rb. the usage of class_eval is different with "class_eval(string, <, file, <line>>)" somewhat, i don''t understand this usage, who can explain it more detail to me? def cattr_writer(*syms) syms.flatten.each do |sym| class_eval(<<-EOS, __FILE__, __LINE__) unless defined? @@#{sym} @@#{sym} = nil end def self.#{sym}=(obj) @@#{sym} = obj end def #{sym}=(obj) @@#{sym} = obj end E...
2008 Feb 27
0
Activesupport error on start - extract_options
...boot.rb (added absolute paths where required) I can run: ''ruby "\storage card\rails\script\server"'' (with any or no options) and eventually get the following error: rails/vendor/rails/activesupport/lib/active_support/core_ext/class/attribute_accesors.rb:24:in ''cattr_writer'': undefined method ''extract_options!'' for [:silencer]:Array (NoMethodError) .. vender/rails/activesupport/lib/active_support/clean_logger.rb:18 .. vender/rails/activesupport/lib/active_support.rb .. vender/rails/railties/lib/commands/server.rb .. script/server .. Can a...
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 accurately. Module is the superclass of Class, is there any possi...
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
2006 Apr 04
26
Models accessing the session...
Can someone tell if there is a reason models shouldn''t access the session? Models could easily be made to access the session or some other shared persistant data store such as a file or a table. _This is the problem_, a model needs to know certain information eg. the id of the current user. But the model has no idea about anything outside of its self, because it can''t access