similar to: Newbie question - self.var OR @var in ActiveRecord

Displaying 20 results from an estimated 7000 matches similar to: "Newbie question - self.var OR @var in ActiveRecord"

2006 Sep 25
1
ActiveRecord instead of direct sql execution
Hi all, I have 2 tables and a standard one-to-many association. How do I substitute the following sql with ActiveRecord calls so that it uses just one sql statement: update geo_entities set terminal_id = 3 where id = 10 or id = 23 or id = 87; Thank you! Regards, Yuri Leikind --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to
2008 Jan 02
3
Submitted a patch, got pluses, what now?
Hello Rails people, I submitted a patch recently to get rid of an annoying exception raised when an AR object is created - http://dev.rubyonrails.org/ticket/10556 , had some people review it, got some pluses... What am I supposed to do now? Can anybody advise or just review the patch and take care of the issue? Thanks! -- Best regards, Yuri Leikind
2004 Jul 20
7
radiobuttons are weird in 1.2.x series
Hello all, Run groupbox.rb example in any of the two alpha versions and click the radiobutton in the upper right group box (those named Hilvesum 1, Hilversum 2, etc). You''ll notice that once a radiobutton is checked, it remains checked when some other radiobutton is checked. What''s the reason? Thank you. -- Best regards, Yuri Leikind
2007 May 10
5
Pagination has many through problems
I have searched for days for an example that demonstrates what i would like to do, and this morning i thought i''d worked it out, but no....here''s what i have: Controller ========== class ProfilesController < ApplicationController def friends current_user.profile.friends end def list_friends @profile_pages, @profiles = paginate( friends, :per_page => 10) end end
2008 May 08
1
Eager loading of association extensions
Hello all, Is it possible to do eager loading of association extensions? That is, the following code produces one SQL query: cat = ProductCategory.find(:first, :include => :pricing_rules) cat.pricing_rules But if in ProductCategory I have an association extension like this: has_many :pricing_rules do def applicable() find(:all).select(&:applicable?) end end the
2007 May 10
2
Dynamic counter?
Hi, In a form I have a text area T and a disable text field C (for counter). C must show dynamically how many characters have been typed in T. Should I go in for a Javascript solution (or Ajax) or is there any other way? Thanks, Ram. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are
2009 Oct 05
11
Unable to install plugins from github
Hi All, My operating system is FC11...I tried to install will_paginate from github directly like this - script/plugin install git://github.com/mislav/will_paginate.git But I get an error saying [ckkashyap@KingCobra test_plugin]$ script/plugin install git://github.com/mislav/will_paginate.git Plugin not found: ["git://github.com/mislav/will_paginate.git"] I have git on my machine - I
2007 May 08
5
Which version of Ubuntu to use with Rails
Hello, This is a question for folks who are using Ubuntu to host your Rails apps. Which version of Ubuntu do you use? Do you use the ''Dapper'' release (6.0.6) perhaps due to the long term support (LTS), or are you using the latest release ''Feisty'' (7.0.4)? Or maybe a better way to ask the question is, is there a preferred version of Ubuntu to use with Ruby
2008 Apr 17
1
Callback Problem: Why to use self.var= instead of @var=
Hi, I''ve defined the following model: class Eintrag < ActiveRecord::Base before_validation :vali protected def vali # self.feld1.reverse! self.feld2 = self.feld1 end end Now I''m wondering why I have to write self.feld2=self.feld1 and why @feld2=@feld1 doesn''t work. I''ve found the thread
2007 Jul 01
1
ActiveRecord: why does 'self.name' and 'name' both work?
I''m trying to figure out why both ''self.name'' and ''name'' work in a model class. For example: class Category < ActiveRecord::Base before_save :set_permalink private def set_permalink # both work self.permalink = name self.permalink = self.name # doesn''t work permalink = name @permalink = name @permalink =
2003 Jul 11
3
short puzzles
Dear R users, can someone help with these short puzzles? 1) Is there a function like outer() that evaluates a three-argument function on a threedimensional grid - or else how to define such a function, say, outer.3()? E.g., calculate (x/y)^z on (x,y,z) element of {1,2,3}x{3,4}x{4,5} and return the results in a 3-dimensional array. I would naively use outer() on two of the arguments within a
2006 Jan 06
2
sudoku
Any doubts about R's big-league status should be put to rest, now that we have a Sudoku Puzzle Solver. Take that, SAS! See package "sudoku" on CRAN. The package could really use a puzzle generator -- contributors are welcome! -- David Brahm (brahm at alum.mit.edu) [[alternative HTML version deleted]] _______________________________________________ R-packages mailing list
2006 Jan 06
2
sudoku
Any doubts about R's big-league status should be put to rest, now that we have a Sudoku Puzzle Solver. Take that, SAS! See package "sudoku" on CRAN. The package could really use a puzzle generator -- contributors are welcome! -- David Brahm (brahm at alum.mit.edu) [[alternative HTML version deleted]] _______________________________________________ R-packages mailing list
2006 May 26
9
What syntax is this? belongs_to :Person
so when I''m reading the pick axe book second edition I don''t see anything like the syntax you see people using in rails code. Specifically when you see. belongs_to :Person has_many :Phones etc these are methods on ActiveRecord right? Why is this invocation syntax never described in the Pick Axe book? I do see things like attr_reader :some_attribute etc but you
2011 Aug 26
1
[LLVMdev] Build breaks in lib/CodeGen
I checked recent revisions 138624 and 138620 and both produce this log with gcc-4.6.0 on FreeBSD-8.2-STABLE amd64: gmake[2]: Entering directory `/usr/home/yuri/llvm-svn/llvm-objects/lib/CodeGen' llvm[2]: Compiling LLVMTargetMachine.cpp for Release build /usr/home/yuri/llvm-svn/llvm/lib/CodeGen/LLVMTargetMachine.cpp:253:3: error: ‘AsmStreamer’ does not name a type
2007 May 22
3
Comments wanted about spec''ing out a couple controller methods
(oops, accidentally sent this to the rspec-devel list, sorry about that) Could someone help me spec out these Rails controller methods? I don''t know where to get started, especially with the transaction stuff. Or, if anyone else could suggest ways I could improve the code, that would be great as well. Puzzle has_one Media. Both are AR model objects. class PuzzlesController <
2012 Jul 05
5
[LLVMdev] [PATCH] with no response: Bug 13163 - BlockAddress instruction with use from the global context is damaged during module link
I think my patch fell through the cracks: http://llvm.org/bugs/show_bug.cgi?id=13163 Could anybody please check it in? Thanks, Yuri
2012 Jun 27
2
[LLVMdev] Compiler warnings with gcc-4.7.1
I just switched gcc from 4.6.2 to 4.7.1 and see the massive amount of warnings, see few examples below. They mostly didn't exist with gcc-4.6.2. rev.159224 Yuri /usr/home/yuri/llvm-2012-06/latest-unpatched/llvm-fix/include/llvm/ADT/PointerUnion.h:56:10: warning: enumeral mismatch in conditional expression:
2013 Apr 18
3
[LLVMdev] [PATCH] with no response: Bug 13163 - BlockAddress instruction with use from the global context is damaged during module link
On 10/02/2012 13:01, Duncan Sands wrote: > > I think Chris is the right person to look at this, hopefully he will. Now 5 months passed. I updated the patch for this current revision. Can anybody review this and check in please? http://llvm.org/bugs/show_bug.cgi?id=13163 Yuri
2011 Feb 20
3
[LLVMdev] Announcing: LLVM 2.9 Tentative Release Schedule
On 02/19/2011 14:52, Yuri wrote: > Will MC path for JNI be included in 2.9? > Sorry. I meant: Will MC path for JIT be included in 2.9?