search for: class_attribute

Displaying 9 results from an estimated 9 matches for "class_attribute".

2012 Sep 28
Overriding class_attribute writers and order of super/extend C.M./included block eval in ActiveSupport::Concern
I have: module MySpike extend ActiveSupport::Concern included do class_attribute :foobar, instance_writer: true end end But, I want to be able to override the class attribute writer and/or instance writer method to do something when the attribute is set via self.foobar = true before or after calling super to set the attribute. Unfortunately, I can''t find a cl...
2011 May 28
class_inheritable_accessor => class_attribute
I had code class_inheritable_accessor :attrs, :instance_reader => false, :instance_writer => false self.attrs = {} now i want to get rid of class_inheritable_accessor, but class_attribute only supports instance_writer, not instance_reader options and i really don''t want instance reader. Is there any way to do it? -- 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 rubyonra...
2012 Oct 16
`method_missing_without_paginate': undefined method `class_attribute' for ActiveRecord::Base:Class
...ements is deprecated and will be removed on or after August 2010. Use #requirement /home/bacancy/Demo_app/smart/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:1959:in `method_missing_without_paginate'': undefined method `class_attribute'' for ActiveRecord::Base:Class (NoMethodError) from /home/bacancy/Demo_app/smart/vendor/gems/mislav-will_paginate-2.2.3/lib/will_paginate/finder.rb:164:in `method_missing'' from /home/bacancy/.rvm/gems/ruby-1.8.7-p370...
2012 Feb 16
How to disable instrumentation in rails 3?
There is a bug in jruby that causes thread locks around things like accesses to class attributes created with class_attribute. The notifications system is affected by this, and it''s blowing up our app. We need to disable all instrumentation and notifications for the time being. Anyone know how to do that cleanly? CHris -- You received this message because you are subscribed to the Google Groups "Ruby...
2010 Sep 08
Unintended side-effect from before_remove_const?
...A simple one-liner, it would appear, but AR::Base implements before_remove_const to do a bit of scoped method cleanup... It''s the only thing I can see that might cause the problem, which is: When accessing an AR::Base subclass via a reflection''s klass accessor, it seems as though class_attributes which are set up via macros (attr_unsearchable in the MetaSearch case, but I also checked with attr_protected) do not have their values. Commenting that single line: constantize(const).before_remove_const if constantize(const).respond_to?(:before_remove_const) will cause the failures to come an...
2012 Sep 08
dash symbol
In the example below, what is the dash doing between the class attribute and array: (field_helpers - [:label, :check_box, :radio_button, :fields_for, :hidden_field, :file_field]).each do |selector| -- 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
2011 Jul 14
subclasses with inherited_resources?
I''m trying out inherited_resources and so far so good. However, one problem I''ve run into is that it''s very difficult to customize inherited_resource behaviour in subclasses. Looking through the source I see it uses things like undef_method and class_attribute. For example, if I have the following controllers: class ItemsController inherit_resources actions :new, :create def create # custom stuff here creat! end end class VideoController < ItemsController actions :new, :create, :show end videos controller will not respond to ...
2012 Oct 03
Is there planned support for permitting params one at a time vs. all at once in strong_parameters/Rails 4?
Was going to have a variety of request params sent in and use a class_attribute that would define types of request parameters that are allowed. strong_parameters wouldn''t be too much trouble in such a case if it would allow me to manually permit some attributes (dynamically determined) in the controller but allow strong_parameters to enforce security of others. I...
2010 Aug 06
[PATCH] GSoC 2010 - Memory hotplug support for Xen guests - second fully working version - once again
..._XEN_MEMORY_HOTPLUG) && defined(CONFIG_XEN_BALLOON) - if (xen_domain()) - balloon_update_stats(-PAGES_PER_SECTION); -#endif break; default: WARN(1, KERN_WARNING "%s(%p, %ld) unknown action: %ld\n", @@ -357,13 +341,6 @@ memory_probe_store(struct class *class, struct class_attribute *attr, phys_addr = simple_strtoull(buf, NULL, 0); -#ifdef CONFIG_XEN_MEMORY_HOTPLUG - if (xen_domain()) { - ret = xen_memory_probe(phys_addr); - return ret ? ret : count; - } -#endif - nid = memory_add_physaddr_to_nid(phys_addr); ret = add_memory(nid, phys_addr, PAGES_PER_SECTION <&l...