similar to: model.find(:id) and model.find(:all) giving different result

Displaying 20 results from an estimated 1000 matches similar to: "model.find(:id) and model.find(:all) giving different result"

2006 Aug 02
9
RJS not cross browser compatible?
I have an RJS template that does the following page.insert_html :bottom, "some_id", ''<tr id="some_id"><td></td></tr>'' This works just find in safari and firefox. In IE and Opera it doesn''t work so great. Any ideas? Am I doing something wrong here? -- Posted via http://www.ruby-forum.com/.
2006 Jun 26
2
DRY up selects in view
Here''s what I''ve got: <% @fields.each do |field_name| %> <tr> <td> <%= field_name.humanize %> </td> <td> <% unless field_name =~ /_id$/ %> <%= form.text_field field_name, :size => 40 %> <% else %> <%= select(:vendor, field_name, State.find(:all, :order
2020 Apr 02
3
RFC: dynamic_cast optimization in LTO
<font face="Verdana,Arial,Helvetica,sans-serif" size="2"> <span><div>Hi,<br>There was a mention of optimizing away C++ dynamic_casts in LTO in this presentation: <a href="https://www.youtube.com/watch?v=Fd3afoM3UOE&t=1306" target="_blank">https://www.youtube.com/watch?v=Fd3afoM3UOE&t=1306</a><br>I
2005 May 19
5
[OT] Sqlite2 question
So, under Sqlite2, if I want to update a database''s schema, I have to dump the DB, modify the table''s structure, then go and modify EVERY insert statement. The insert statements look like (from memory): INSERT INTO my_table VALUES (''some_id'', ''some_val'', '''', '''', '''', ''some_other
2006 May 03
2
Using a helper within another helper?
I am trying to push some view logic into a helper. The thought is that this is a step towards having the business logic in the helper rather than the view. However, I''m essentially wrapping the checks around an eventual call to date_select(). The problem I''m having is that the application complains that it doesn''t know about date_select(). I''m sure (or
2019 Dec 11
5
RFC: Safe Whole Program Devirtualization Enablement
Please send any comments. As mentioned at the end I will follow up with some patches as soon as they are cleaned up and I create some test cases. RFC: Safe Whole Program Devirtualization Enablement =================================================== High Level Summary ------------------ The goal of the changes described in this RFC is to support aggressive Whole Program Devirtualization without
2006 Jun 17
0
Dynamic forms containing collections
Hiall, I have the following problem: I need to use forms containing collections (i will call them FCC), and I want to construct them dynamically, as I need to deal with quite large forms (more than 600 input fields). The variables @model_name and @field_name contain the proper model and field names as strings, which is enough for "normal" form input fields. (i.e. the "if
2009 Oct 14
6
Reinstantiate controller during functional testing
... ok, I may be going about this the wrong way, or perhaps, a less efficient way than is optimal, but I would like to test a little bit of AJAX on one of my web pages. When I test this by hand, I bring up the page which shows a select box, I select an item from the drop down list, see another select box show up, go back to the first select box, select a different item, and see something
2009 Sep 28
6
What is the most efficient way to split a table into 2 groups?
I have the following: @lot = Lot.find(params[:id]) part_nums = Part.all(:conditions => ["id <> ?", @lot.part.id]) I guess I should mention that Lot :belongs_to => :part I was looking at the log following the execution of these two statements and I saw something like this: Lot Load (0.4ms) SELECT * FROM "lots" WHERE ("lots"."id" = 13) Part
2006 Jul 10
18
Deleting join association of has_many :through
I''m trying to use has_many :through, since my join model deserves being more than just an intersection table. But when I try to break the association, the break only seems "temporary": Let''s say my two tables are Users and Colors, and the join model is Favorites. user = Users.find(1) user.colors.length >> 2 c = user.colors.first >> #<Color:....>
2010 Jul 26
1
form date helper with text year
I have a date where the year range is more then I want to define in a select_date scaffold generated year range. My idea was to have the year entered as a text field and the month and day using something like: <%= select_month @person.born,:prefix => :person ,:field_name => "born(2i)" %> <%= select_day @person.born,:prefix => :person , :field_name =>
2015 Jun 20
1
Xapian with Json
Hi ! I?m newbie with Xapian ! I?m looking for the best way to index json data to be able to search by name/value pair and Full Text Search using only Xapian. I did haven?t success to found a complete or a good documentation about json index and search. Do you know some documentation about ? Another problem that I have is that: In the same name/value pair sometimes I have different data types
2006 Feb 20
0
Override automatic accessor for reference field in model
When a column in a database table is actual data, rather than an fkey to another table, I can override the automatic accessor by just doing the following: def field_name # do something here read_attribute(field_name) end This does not seem to work for me if the field is an fkey, say user_id, linking to another table. I''ve made this work by aliasing the accessor like this: alias
2010 Dec 21
2
Fetch without setting flags
Hello, I'm customizing squirrelmail and I want to print a line from the message in front of the subject in mailbox listing (like gmail). the problem is, when I use 'FETCH {SOME_ID} BODY[]' the message gets marked as seen. How can I fetch without setting the senn flag ? Thanks Behrooz
2006 Feb 02
5
access controller var within model
I need to access params[:field_name] from within my Model. @params[:field_name] isn''t working?
2006 Oct 05
4
search results autocompletion
Dear list, I ''m using a text input field with autocompletion . The suggestions come from a ferret index which is created by getting all the terms belonging to other indices. Here is the code: class Suggestion attr_accessor :term def self.index(create) [Person, Project, Orgunit].each{|kl| terms = self.all_terms(kl) terms.each{|term| suggestion =
2007 Oct 03
2
How to Deactivate a button
How do you make a button inactive, so that it is visible, but it will not respond to clicks? Thanks Jayson
2006 Apr 27
3
collection_select to display 2 fields
I''m trying to get a collection_select generated Drop-down box to display two fields from a table (first name & last name); however, I am having trouble concatenating the symbols. It appears as though any code I put in the 5th argument for collection_select is processed prior to executing the collection_select method. The code executes successfully with 1 symbol in the 5th
2006 Jan 18
4
That ol'' AJAX select box update again : observe_field does nothing
Hi, I know this has been asked a million times before - but I still don''t really get it. CAn someone please tell me what''s up with the following; In a view I have (apologies for the formatting); <td> <select id="job.job_phase_id" name="job[job_phase_id]"><p><label for="job_job_phase_id">Job
2015 Aug 31
0
[PATCH v5 1/2] cat: move get_journal_field to fish/journal.c
--- cat/Makefile.am | 1 + cat/log.c | 114 +------------------------------------------- fish/Makefile.am | 1 + fish/journal.c | 142 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 145 insertions(+), 113 deletions(-) create mode 100644 fish/journal.c diff --git a/cat/Makefile.am b/cat/Makefile.am index d0db6fa..d472100 100644 --- a/cat/Makefile.am +++