similar to: Different ferret fields for instances of the same model?

Displaying 20 results from an estimated 3000 matches similar to: "Different ferret fields for instances of the same model?"

2007 May 10
13
Is there a way to do incremental search?
Say the user first enters "ruby" for search and gets 1000 results. Then he can search "rails" just in the 1000 results just returned. The common scenario is some kind of advanced search. User can incrementally add criteria and the program will narrow the results step by step. I know that at least I can use all the criteria as a whole to do the searching, but this is a waste
2012 May 07
6
[LLVMdev] Metadata for Argument, BasicBlock
Hi Duncan, On 5/6/12 6:12 PM, Duncan Sands wrote: > Hi Ralf, > >> Is there a clean way to attach metadata nodes to Arguments and/or >> BasicBlocks? > > not at the moment. Feel free to work on adding this functionality! I am looking into that now. I decided to temporarily go for the following syntax for BasicBlock metadata (subject to discussion): entry:
2018 May 29
2
Can creating new forms of debug info metadata be simplified? [formatting fixed]
Thanks all for your response. On Tue, May 29, 2018, at 5:38 PM, Duncan P. N. Exon Smith wrote: > > >> On May 29, 2018, at 12:55, Adrian Prantl <aprantl at apple.com> wrote: >> >> >> >>> On May 29, 2018, at 12:28 PM, David Blaikie <dblaikie at gmail.com> wrote: >>> >>> +some of the debug info cabal (& Duncan, as an
2012 May 15
0
[LLVMdev] Metadata for Argument, BasicBlock
So, is there any chance that metadata for basic blocks is considered a useful feature? There is a patch ready and on the commits-list, it compiles, passes all tests, has a test case of its own, and (as far as I can tell) does not interfere with anything. Cheers, Ralf On 5/7/12 4:21 PM, Ralf Karrenberg wrote: > Hi Duncan, > > On 5/6/12 6:12 PM, Duncan Sands wrote: >> Hi Ralf,
2012 May 06
2
[LLVMdev] Metadata for Argument, BasicBlock
Hi everybody, Is there a clean way to attach metadata nodes to Arguments and/or BasicBlocks? It looks to me like one can directly attach metadata only to instructions. My current workaround is to insert a call to a dummy function that holds metadata for its parent block - pretty ugly, but manageable. The same problem arises when I want to store specific information about the arguments of a
2012 May 06
0
[LLVMdev] Metadata for Argument, BasicBlock
Hi Ralf, > Is there a clean way to attach metadata nodes to Arguments and/or > BasicBlocks? not at the moment. Feel free to work on adding this functionality! > It looks to me like one can directly attach metadata only to instructions. > My current workaround is to insert a call to a dummy function that holds > metadata for its parent block - pretty ugly, but manageable. The
2012 Sep 11
1
define_method vs module_eval
Rails code: Accessors.send :define_method, :"default_#{name}", &block Accessors.module_eval <<-METHOD, __FILE__, __LINE__ + 1    def #{name}    -ISKimRw02aC5oVgD8gxYQQ@public.gmane.org(:#{name}, [])    end    def #{name}=(value)    value = value.present? ? Array(value) : default_#{name}    _set_detail(:#{name}, value) if value != @details[:#{name}]    end  
2018 May 29
0
Can creating new forms of debug info metadata be simplified? [formatting fixed]
> On May 29, 2018, at 15:33, Sohail Somani (Fizz Buzz Inc.) <sohail at fizzbuzzinc.com> wrote: > > Thanks all for your response. > > On Tue, May 29, 2018, at 5:38 PM, Duncan P. N. Exon Smith wrote: >> >> >>> On May 29, 2018, at 12:55, Adrian Prantl <aprantl at apple.com> wrote: >>> >>> >>> >>>> On May 29,
2005 Dec 15
3
define_method with parameters
Hi, I''m trying to write a macro which defines methods. One of these should have a parameter, but I can''t get that to work. Something like: define_method("printstuff") do puts "blabla" end works fine. But, how do I use define_method to create something like: def printstuff(the_stuff) puts the_stuff end Thanks in advance.
2006 Oct 10
3
Dynamic fields and inheritance
I have a model that allows subclasses to dynamically define fields. The following code is a short test case that illustrates the problem I''m having: class Product < ActiveRecord::Base acts_as_ferret :fields => [:name] serialize :data def self.data_properties (*properties) properties.each do |property| define_method(property) {self.get_property(property)}
2007 Sep 30
2
Outputing to the browser, how?
Hello, I''m writting some helper methods to write forms, so I have this working code: class TableFormBuilder < ActionView::Helpers::FormBuilder ["file_field", "password_field", "text_field"].each do |name| define_method(name) do |label, *args| @template.content_tag(:tr, @template.content_tag(:td, @template.content_tag(:label,
2006 Jun 08
3
Macros and stuff
I was looking at my controller code and the edit/create/update/new for each are practically identical. So first I DRY''d the four methods in each controller to just one and then I decided to write a single macro for all my controllers. This is the macro: def self.edit_action_for(model, options = {}) model_class = Object.const_get(model) define_method(:edit) do
2018 May 29
0
Can creating new forms of debug info metadata be simplified? [formatting fixed]
> On May 29, 2018, at 12:55, Adrian Prantl <aprantl at apple.com> wrote: > > > >> On May 29, 2018, at 12:28 PM, David Blaikie <dblaikie at gmail.com <mailto:dblaikie at gmail.com>> wrote: >> >> +some of the debug info cabal (& Duncan, as an emeritus member, and person who plumbed a lot of the current debug info syntax support in) >>
2007 Jan 29
2
What does Reloadable mean in rails source code?
In the actionpack-1.12.5\lib\action_controller\base.rb, you can see the definition: class Base include Reloadable::Subclasses ... And following is the definition of Reloadable: # Classes that include this module will automatically be reloaded # by the Rails dispatcher when Dependencies.mechanism = :load. module Reloadable class << self def included(base) #nodoc: raise
2008 May 07
1
Assigning to the foreign key on a belongs_to association
I''ve encountered what seems like an odd omission in the behaviour of belongs_to associations: if you assign to the foreign key attribute, it doesn''t update the associated object (or mark a previously loaded one as stale) until you explicitly save or reload it. Let''s say we have a Company model, which belongs_to :city : >> torchbox =
2007 Oct 23
3
CheckListBox : delete method bug !
Hi, I''ve practically finished a patch for removing the limitation of CheckListBox (http://rubyforge.org/pipermail/wxruby-development/2007-October/000973.html) but I just discovered a new bug related with this control !! I need to redefine the delete method to take into account the deletion of the associated data. The problem is that if I just redefine this method and simply call super,
2011 Jan 08
4
Help How to create DSL for conditional validations
Hi All, I am new to Ruby and ROR I were trying to create small DSL for conditional validations valid_with_cond :bypass_validation do if self.addresses > 3 errors[:base] << "Can not have more than 3 addresses". end end By this I wanted to create array of method and call them all in custom validation method. this above code I wanted to do attr_accessor
2006 Feb 15
2
Polymorphic joins work one way, but not the other
I''ve been using polymorphic joins from edge rails based on about 5 lines of advice Rick Olson gave me over IRC. There''s some sparse documentation popping up but it seems to cover a somewhat different case. Anyway - I pretty much got it to work - save for one detail. Here''s what I have: class Event < ActiveRecord::Base belongs_to :attachable, :polymorphic =>
2007 May 20
9
How to test for exceptions
Hi folks, I''m in the process of converting a Test::Unit functional test to RSpec, but I''ve run into a slight problem. I tried looking through the documentation but I still don''t know what I missed. Thanks in advance, Blake describe VenuesController, "on update" do before(:each) do @venue = mock("venue")
2006 Jun 17
5
STI versus Composition...or the headaches of one big table
Guys, I have a relationship between model classes that I believe is best represented by inheritance, but the likelihood that things will change often is driving us to composition instead. So, I have a class called Autos, and subclasses called Suvs, Minis, Mids, Sports, for example. We have been requested to avoid the STI approach to this, because of fear of a quickly growing table with