search for: quoted_id

Displaying 6 results from an estimated 6 matches for "quoted_id".

Did you mean: quote_id
2007 Apr 03
0
[Sybase Adaptor] find_by_xxx does not work correctly.
...: RuntimeError: SQL Command Failed for User Load: SELECT * FROM users WHERE (users.[code] = 1) This SQL should be quote like this SELECT * FROM users WHERE (users.[code] = "1") * probelm source sybase_adapter.rb 279 def quote(value, column = nil) 280 return value.quoted_id if value.respond_to? (:quoted_id) 281 282 case value 283 when String 284 if column && column.type == :binary && column.class.respond_to?(:string_to_binary) 285 "#{quote_string(column.class.string_to_binary(value))}" 286...
2008 Feb 20
0
Unicode Support for MS SQL Server
...ar. 2) Prepend any quoted values going into nvarchar columns with a capital-letter-N, e. g. ''unicode'' becomes N''unicode'' In order to accomplish this, I modified SQLServerAdapter#quote to look like this: def quote(value, column = nil) return value.quoted_id if value.respond_to?(:quoted_id) case value when TrueClass then ''1'' when FalseClass then ''0'' when Time, DateTime then "''#{value.strftime("%Y%m%d %H:%M:%S")}''&quo...
2008 Sep 25
1
defining polymorphic type condition
...odel" 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}.#{@reflection.primary_key_name} = #{@owner.quoted_id}&...
2006 Feb 23
3
has_many reference
...; c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1509:in `read_attribute'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1198:in `id'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1209:in `quoted_id'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations/has_many_association.rb:169:in `construct_sql'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations/has_many_association.rb:8:in `initialize'' c:/ruby/lib/ruby/...
2006 Feb 26
4
Creating objects with has_many :through relationship
Three tables: users: id clients: id admin_contacts: user_id, client_id class Client has_many :admin_contacts has_many :contacts, :through => :admin_contacts, :foreign_key => :user_id, :class_name => ''User'' end I added the :contacts for ease of use of grabbing the user objects associated with the admin_contact. This all works great, I can grab the Users that
2007 Dec 06
43
Mocks? Really?
OK, so i''ve played a bit with mocks and mock_models in controller and view tests and i have a question. Is this statement really correct: "We highly recommend that you exploit the mock framework here rather than providing real model objects in order to keep the view specs isolated from changes to your models." (http://rspec.rubyforge.org/documentation/rails/writing/views.html