Displaying 20 results from an estimated 800 matches similar to: "Automatically Indexing Associated Models"
2006 Apr 25
2
JRS problem
Hi all,
I''m playing with the new RJS stuff. Very cool!
But I have a problem. The following code works ok:
page.select(''div.blogcomment'').each do |element|
page.visual_effect :highlight, element
end
All div''s with class blogcomment are highlighted correctly. But I just
want the last elemen to be hightlighted. The following code is not
working:
2006 Nov 28
17
Index not being updated
My index is not being updated when I add new records or amend existing
ones.
Can anyone point me in the direction of where I should be looking for
what is going wrong?
I''m running this in the production environment.
--
Posted via http://www.ruby-forum.com/.
2006 Sep 18
3
Automatic reindexing of associated columns acts_as_taggable
Hi,
So i''m trying to use acts_as_taggable with the acts_as_ferret plugin,
where I have Post.rb model, which has a method tag_list made available
through acts_as_taggable, as returns a string of associated tag words
from the tags table (tag.rb). I''ve set up my Post.rb model in the
following way.
class Post < ActiveRecord::Base
acts_as_taggable
acts_as_ferret
2006 Sep 07
6
form_for - Child object - how to set parent id
Hi All,
I am just trying to learn ruby/rails so please don''t flame me if this is
a stupid question.
As a learning project I decided to create my own blog using ROR. I have
created a controller that shows paged blog entries, and below each blog
is a list of comments along with a form alowing the user to add a new
comment.
To create the form for the comment entry I used form_for
2006 Aug 25
7
disabling automatic indexing in acts_as_ferret
I''d like to be able to enable/disable the automatic indexing of
documents acts_as_ferret does. Something like MyModel.disable_indexing
MyModel.enable_indexing would be perfect. I need this because I do some
indexing that requires visiting the parents of the model objects and my
import method imports the children first, so the information isn''t there
yet. I''d like to
2006 May 17
9
Render No Layout?
Hi guys,
Am having a problem.
I have this def in my index controller that works like this:
def do_something
$a = variable1
$b = variable2
$c = variable3
$d = ""<script language=\"Javascript\"> \n new Insertion.Bottom(''#{$c}'',
''#{$a} - #{$b}''); \n </script>"
$trigger = "1"
render(:partial =>
2010 May 04
3
Idiomatic looping over list name, value pairs in R
Considering the python code:
for k, v in d.items(): do_something(k); do_something_else(v)
I have the following for R:
for (i in c(1:length(d))) { do_something(names(d[i]));
do_something_else(d[[i]]) }
This does not seem seems idiomatic. What is the best way of doing the
same with R?
Thanks.
Luis
2015 Jul 16
3
[LLVMdev] why LoopUnswitch pass does not constant fold conditional branch and merge blocks
Hi,
I have a general question on LoopUnswtich pass.
Consider the following IR snippet:
define i32 @test(i1 %cond) {
br label %loop_begin
loop_begin:
br i1 %cond, label %loop_body, label %loop_exit
loop_body:
br label %do_something
do_something:
call void @some_func() noreturn nounwind
br label %loop_begin
loop_exit:
ret i32 0
}
declare void @some_func() noreturn
After running
2007 Aug 06
4
acts_as_ferret cross model index not updating
Does anyone know how do you get acts_as_ferret to automagically update
non-standard fields?
I''ve followed Rails Envy''s tutorial
(http://www.railsenvy.com/2007/2/19/acts-as-ferret-tutorial#nonmodel) to
get aaf working across different models. And once the index is built it
searches fine.
In my (main) model, I''ve put:
acts_as_ferret :fields => [ :name,
2012 Nov 26
3
Passing lists between functions
I'd like to pass a list object created by one function as an argument of
another function. once inside the second function, I'd like to break the
list up to it's individual elements, each then identifiable by the 'names'
of the list.
The list looks something like
lst<-list(a=1, b=2, df=5, g=7)
then inside the function I've been writing a sequence of statements that
2006 Sep 05
0
rake craziness with Migrate as a dependency
Hi everyone,
For one of our projects we have a need to deploy and maintain a demo.
As a result I''ve attempted to setup a set of rake tasks for the job.
My goal is have one rake task called "deploy_demo" which purges the
database, migrates to the current schema, and loads the db from a set
of fixture files in a specified location.
I''ve written two new tasks the perform
2018 Jun 20
4
[RFC] Removing debug locations from ConstantSDNodes
Some time ago I saw a report of strange single-stepping behavior given Swift code that looks like this:
1| var input = [16, 14, 10, 9, 8, 7, 4, 3, 2, 1] //< Only number 1 is relevant.
2| print("start")
TL;DR: The debugger steps from line 2 -> 1 -> 2 in this code example. One clean way to fix this bug is to remove debug locations from ConstantSDNodes, and I'm asking if
2007 Apr 11
4
Feature request... I think...
Folks-
I just started using Mocha and I wanted to try something but I
couldn''t get it to work. I''m coming from the Java world, so my
approach may not be optimal for Ruby.
Say I''m testing a.do_something() which calls b.do_other_thing() twice,
but I really don''t want to change b.do_other_thing(), just ''expect'' it
to be called twice. I know I
2018 Jun 20
2
[RFC] Removing debug locations from ConstantSDNodes
> On Jun 19, 2018, at 6:36 PM, Reid Kleckner <rnk at google.com> wrote:
>
> On Tue, Jun 19, 2018 at 5:46 PM Vedant Kumar <vsk at apple.com <mailto:vsk at apple.com>> wrote:
> Someone (Reid?) mentioned that we could try sinking constants to their point of first use as an alternative, and (IIUC) create new nodes with distinct DebugLocs for each use of a constant. I
2007 Apr 10
6
getting output of STDOUT in spec
Consider the following method:
def name_to_terminal
puts "Scott Taylor"
end
How would I spec this out?
Scott
2018 Apr 09
3
InductiveRangeCheckElimination and BranchProbabilityInfo
Hi,
extractRangeChecksFromBranch uses BranchProbabilityInfo to decide whether its worth trying the InductiveRangeCheckElimination transformation. For the following example:
void split() {
for (int i = 0; i < 100; ++i) {
if (i < 99)
do_something()
else
do_something_else()
}
}
But the reported BPI is reported as 50/50 to whether do_something will be called, but we
2018 Jun 20
5
[RFC] Removing debug locations from ConstantSDNodes
FWIW: Debug information on constants feels odd to me. They are just values not something that is executed so conceptually I would not expect them to "happen" at a specific time/place in the program. That said most numbers are copied into registers or stored into memory and that is of course an interesting action. So in the original example I would hope to see debug info on whatever
2006 Dec 11
1
Index help on Polymorphic Associations
Hello,
I''m a newbie to aaf and rails and I hope anyone can help me with this.
I have the following Models:
class Project < ActiveRecord::Base
acts_as_authorizable
acts_as_audited :except => [:created_by, :updated_by ],
:user_class_name => ''AuthenticatedSystem'', :user_method =>
''current_user''
acts_as_ferret :fields => {:name =>
2007 Mar 20
1
Passing Arguments to before_filter
I want to put a before_filter in application.rb, as follows:
before_filter :do_something, :except_controller => [:admin]
def do_something(options)
options.stringify_keys!
unless options[:except_controller].include?(controller_name)
# do something useful
end
end
Where I''m blocking is on how to get the ''options'' data in the do_something
method. I think I
2010 Jan 28
3
Using tcltk or other graphical widgets to view zoo time series objects
Dear all,
I am looking at the R-help entry below:
http://finzi.psych.upenn.edu/R/Rhelp02/archive/26640.html
I have a more complicatedt problem. I have a zoo time series frame with
100+ sequences.
I want to cycle through them back and forth and compare them to the 1st
column at any time.
I need also a button to click when I need the viewed-selected sequence
(that is being compared to the