search for: quoted_table_name

Displaying 14 results from an estimated 14 matches for "quoted_table_name".

Did you mean: quote_table_name
2008 Sep 25
1
defining polymorphic type condition
...efficient than storing a string like "SomeActiveRecordModel" over and over again. Looking in the association proxy classes for has_one and has_many, I see: def construct_sql case when @reflection.options[:as] @finder_sql = "#{@reflection.quoted_table_name}.#{@reflection.options[:as]}_id = #{@owner.quoted_id} AND " + "#{@reflection.quoted_table_name}.#{@reflection.options[:as]}_type = #{@owner.class.quote_value(@owner.class.base_class.name.to_s)}" else @finder_sql = "#{@reflection.quoted_table_name}.#...
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
2011 Sep 13
4
Changing adapters in ActiveRecord does not change the generated sql
...ELECT `users`.* FROM `users`" These back ticks on column names are mysql specific and are invalid for postgresql, so it throws an error. Does anyone know how to fully clear out whatever it is that is caching this sql being generated?? I searched through the source and was able to unset @quoted_table_name on the user model, this regenerated the table name properly, however the query now looks like: User.scoped.to_sql #=> "SELECT \"users\".* FROM `users`" Still not perfect. And I also don''t want to have to go through each model and unset a bunch of vars....
2009 Mar 03
2
Passing an SQL fragment in AR save
I have a basic model class TestTime with no customization. class TestTime < ActiveRecord::Base end I would like to pass the following SQL fragment as part of an AR save call to TestTime objects. How and where would I do this in the model? "set c_time=current_time" (current_time is an SQL method, not a variable). -- Posted via http://www.ruby-forum.com/.
2010 Jan 26
1
Mongrels Hanging in mysql_adapter.rb
...ication.rb:121:in `retrieve_connection''", "/var/lib/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_specification.rb:113:in `connection''", "/var/lib/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb: 2934:in `quoted_table_name''", "/var/lib/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb: 1626:in `construct_finder_sql''", "/var/lib/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb: 1490:in `find_every''", "/var/lib/gems/1.8/gems/activerecord-2.2.2/...
2008 Nov 03
0
acts_as_rateable in rails 2.2.0
...9;' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.0/lib/active_record/reflection.rb:151:in `send'' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.0/lib/active_record/reflection.rb:151:in `klass'' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.0/lib/active_record/reflection.rb:182:in `quoted_table_name'' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.0/lib/active_record/associations/has_many_association.rb:91:in `construct_sql'' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.0/lib/active_record/associations/association_collection.rb:21:in `initialize'' /Library/Ruby/Gems/1.8/g...
2008 Jun 24
9
ActiveRecord 2.1 Migration support
...0xb6fc8418>, @connection_options=[nil, "root", "", "auction_development", nil, nil], @config={:allow_concurrency=>false, :adapter=>"mysql", :database=>"auction_development"}, @query_cache_enabled=false, @last_verification=0, @quoted_table_names={"schema_migrations"=>"`schema_migrations`", "auctions"=>"`auctions`"}>, name=:title, type="string", limit=255, precision=nil, scale=nil, default=nil, null=nil>, :null=>nil} Ingres {:default=>nil, :column=>#<struc...
2008 Jun 24
9
ActiveRecord 2.1 Migration support
...0xb6fc8418>, @connection_options=[nil, "root", "", "auction_development", nil, nil], @config={:allow_concurrency=>false, :adapter=>"mysql", :database=>"auction_development"}, @query_cache_enabled=false, @last_verification=0, @quoted_table_names={"schema_migrations"=>"`schema_migrations`", "auctions"=>"`auctions`"}>, name=:title, type="string", limit=255, precision=nil, scale=nil, default=nil, null=nil>, :null=>nil} Ingres {:default=>nil, :column=>#<struc...
2009 Aug 28
0
Error connecting to Sybase (odd)
...:in `retrieve_connection'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:3103:in `quoted_table_name'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1583:in `find_one'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1574:in `find_from_ids'' from c:/ruby/lib/ruby/gems/1.8/gems/active...
2009 Mar 18
1
set_table_name woes, fragmented domain class
Hi all, I''m running Rails on top of a Mongrel cluster. I have several model classes that are going to have so many records it is not feasible to keep them all in the same table. So I''ve split out the records into many different tables, each with its own suffix which corresponds to the id of the model to which all records in that particular table belong. For example,
2010 Apr 20
13
why is ActiveRecord tying to select nonex ID column?
I''ve loaded (and updated) thousands of these MeteredUsage records. In the middle of a run, I suddenly get: ActiveRecord::StatementInvalid: Mysql::Error: Unknown column ''id'' in ''where clause'': UPDATE `metered_usages` SET `cost` = 12603.46 WHERE `id` = NULL I can''t see anything that''s different about this particular record compared to
2007 Nov 14
3
Connecting to Oracle from an Intel Mac -- arch. conflicts
...cation.rb:259:in `retrieve_connection'' from /Library/Ruby/Gems/1.8/gems/activerecord-1.99.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in `connection'' from /Library/Ruby/Gems/1.8/gems/activerecord-1.99.0/lib/active_record/base.rb:2222:in `quoted_table_name'' from /Library/Ruby/Gems/1.8/gems/activerecord-1.99.0/lib/active_record/base.rb:1155:in `construct_finder_sql'' from /Library/Ruby/Gems/1.8/gems/activerecord-1.99.0/lib/active_record/base.rb:1035:in `find_every'' from /Library/Ruby/Gems/1.8/gems/activerecord-1.9...
2008 Feb 29
17
Is SQL Server not supported in RoR on the Mac?
....rb:259:in `retrieve_connection'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in `connection'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2438:in `quoted_table_name'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1353:in `construct_finder_sql'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1233:in `find_every'' from /usr/local/lib/ruby/gems/1.8/gems/active...
2009 Jan 11
6
Why does ActiveRecord allow perception of success when updating an ID, however it doesn't really work(i.e. no change in database)?
Hi, Why does ActiveRecord allow perception of success when updating an ID, however it doesn''t really work(i.e. no change in database)? Here''s an example. The update of "id" versus update of a non-existent attribute. ?> ai = AccountItem.find(:first) => #<AccountItem id: 1, account_id: 1, date: "2009-01-11", amount: