similar to: Changing adapters in ActiveRecord does not change the generated sql

Displaying 20 results from an estimated 600 matches similar to: "Changing adapters in ActiveRecord does not change the generated sql"

2006 Feb 22
2
Using ez_where
Hi All, I am trying to pass values to ez_where to construct my conditions. I need to know how the params need to be formated for ez_where. My search class looks like this: def search @display_ad = DisplayAd.new(params[:display_ad]) cond = Caboose::EZ::Condition.new do pub_date == ''@display_ad.pub_date'' io_number =~
2006 Feb 02
2
uninitialized constant
Ok, I searched but couldn''t find anything and I even tried the RoR IRC channel with no help. I get this error: uninitialized constant Airport I used this code which I got from the RoR site. helper :sorting def list @sorter = SortingHelper::Sorter.new self, %w(icao host_id name), @params[''sort''], @params[''order''], ''icao'',
2006 Jan 30
2
:condition not being applied
I am using acts_as_taggable and everything seems to be working except that :condition => "tags_resources.portal_id=#{portal_id}" is not being applied. @resource_pages = Paginator.new self, Resource.find_tagged_with(:any => tag, :condition => "tags_resources.portal_id=#{portal_id}").length, 25, @params[''page'']; @resources
2006 Apr 15
2
ez_where : i''m puzzled
I have the following code: condition_clause = "%#{@phrase}%" logger.info "condition is #{condition_clause}" unless @phrase.nil? condition = Caboose::EZ::Condition.new :affiliates do affiliate_name =~ "%#{@phrase}%" # <<< here''s the problem end options[:conditions] = condition.to_sql logger.info "ajax
2011 May 11
2
Issue with Arel::SelectManager and insert Method
Hello, Arel::SelectManager (arel 2.0.9) uses following statement to insert a new record: @engine.connection.insert im.to_sql, ''AREL'', primary_key_name, primary_key_value But in DatabaseStatements insert ist defined as: insert(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil) Actually, Arel::SelectManager does not use the sequence name. This leads to issues
2008 Sep 17
13
Capturing the sql from a statement without executing it?
Hi guys, Is there an elegant way to capture the sql that would have been executed by an ActiveRecord statement, without actually executing it? :) I''m imagining something like sql = User.find(1).groups.to_sql or perhaps sql = ActiveRecord::Base.capture_sql { User.find(1).groups } resulting in sql = ''SELECT * FROM groups INNER JOIN memberships.... WHERE users.id =
2006 May 23
3
ez-where headscratch
Hi there, I''m puzzled by this apparently simple query I can''t manage to reassemble using ez_where plugin. cond = Caboose::EZ::Condition.new :my_table do start_on < Time.now any {end_on > Time.now; end_on.nil?} end I keep getting the following result : >> cond.to_sql => ["my_table.start_on < ? AND (my_table.end_on > ?)", Tue May 23
2010 Apr 12
2
[PATCH] Access to more Arel predicate types from where condition hash
I could use some eyes on https://rails.lighthouseapp.com/projects/8994/tickets/4368 if anyone has the time. Summary of the change: Similar to PredicateBuilder''s existing support for ''table.column'' => ''value'', this patch enables ''column#method'' => ''value''. For instance,
2006 Jan 19
4
multiple database in the same actions?
Hi, I read the example in http://wiki.rubyonrails.com/rails/pages/HowtoUseMultipleDatabases, it show us how to connect to other database, each time we start a new action, however, this doesn''t work while you try to connect to two different database within the same action. SO I wonder is it possible to bind to two or more database within the same action???? Thanks you very much Saiho
2011 Apr 18
12
Arel - clone bug (and fix), feature requests
Hi all, I''ve been playing around with Arel this week (actually outside of Rails) and found an issue with the clone implementation. I''ve added a patch and a testcase here: https://github.com/codders/arel/commit/660f706491ac012cb133554cffeaa6b9ae6046e9 and made a pull request against the rails/arel repo. I''ve also been playing around with support for ordering on
2012 Apr 23
1
Searching and returning arrays
im a begginer in RoR and am using rails 3.2.3 and ruby 1.8.7 This forum has helped me to progress but I''m confused by one thing. My app is supposed to allow seaching for results depending on the check boxes that are checked. In my case, when the user checks a determined facility and clicks "search" the corresponding hotels with only those facilities should be returned. I can
2010 Jul 16
1
Rails 3 bug: undefined method `<=>' for class `ActiveSupport::Multibyte::Chars'
I''m getting the following bug when I try to run rake db:migrate in Rails 3 beta 4: $ rake db:migrate --trace (in C:/Users/Adam/Documents/Aptana Workspace/QuestionBank) default formats are encoded in ISO-8859-1 ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate == CreateUsers: migrating
2006 Feb 19
8
building multiple find conditions
I am trying to allow for AND type ''find'' but to allow for simply a single set of find criteria. controller code... @vw_string = @vw_string1 = @vw_string2 = @vw_string3 = [] if params[:beg_intake_date] != "" then @vw_string1 = ["intake_date between ? and ?", params[:beg_intake_date], params[:end_intake_date] ] end if
2013 Apr 19
0
Question marks in SQL string literals
Hi all! Recently I discovered that AR tries to treat question marks inside SQL string literals as parameters, however this behaviour shows in very rare cases, for example (very odd, but...): User.where("NOT EXISTS (#{ Comment.where(''user_id = users.id AND body ILIKE ?'', ''%?'').to_sql }) AND created_at > ?", Date.yesterday).to_sql It will fail,
2006 Apr 16
3
variable variables?
Hi everyone, Does Ruby support variable variables like PHP (http://www.php.net/manual/en/language.variables.variable.php)? Or do I have to use eval, like some_hash.each_pair{|key, pair| eval "#{key} = #{value}" } Or is there some other way? I''m actually trying to figure this out in order to use ez_where to create its conditions from a hash, so if this isn''t even
2006 Aug 02
2
mangle ActiveRecord
Dear Gurus on Rails! How do I change the behaviour of one method in ActiveRecord::ConnectionAdapters::SchemaStatements ? Full story: I''d like to mangle ActiveRecord::ConnectionAdapters::SchemaStatements so when it creates a new sql table, it also (optionally) creates my created_at, deleted, key_id, session_id etc columns that I use on basically all tables. It would not be DRY to repeat
2008 Feb 13
4
Migration Issues: Can't update newly added column values
Hello everyone, just wondering if anyone can help me with a migrations question here. Using: rails 2.0.2 ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin] mysql 5.0.45 Platform: windows xp The problem: ---------- I created a migration that is designed to add a column named "deleted_at" (timestamp) and then remove a column named "is_deleted" (boolean). The idea is to
2008 Sep 03
5
Eager load associations in Oracle problem with more than 1000 records
I think Rails 2.1 introduced a bug when eager loading of associations with Oracle. In 2.1 ActiveRecord loads the included table with a big ''IN'' query: ''where association.id in (1, 2, 3, 4...)''. The problem is that Oracle has a hard limit of 1000 values in an IN clause. I get this error: ''OCIError: ORA-01795: maximum number of expressions in a list
2008 Jun 24
9
ActiveRecord 2.1 Migration support
Hi all, I am in the process of adding Migration support to the Ingres ActiveRecord adapter and have run in to a problem. During the call to create_table the Ingres adapter some how causes ruby to blow the stack and coredump/segv. I have tracked down the problem down to "add_column_options!" in "lib/active_record/connection_adapters/abstract/schema_statements.rb".
2008 Jun 24
9
ActiveRecord 2.1 Migration support
Hi all, I am in the process of adding Migration support to the Ingres ActiveRecord adapter and have run in to a problem. During the call to create_table the Ingres adapter some how causes ruby to blow the stack and coredump/segv. I have tracked down the problem down to "add_column_options!" in "lib/active_record/connection_adapters/abstract/schema_statements.rb".