similar to: Any comment on adding #cast and #cast! to ActiveRecord::Relation?

Displaying 20 results from an estimated 1100 matches similar to: "Any comment on adding #cast and #cast! to ActiveRecord::Relation?"

2013 Dec 17
1
ActiveRecord and tiny_tds
Hi, I''m having some issues trying to run .find_by_sql against a Win MSSQL 2008 server. When I use the tiny_tds gem the query works without any issues. require ''rubygems'' gem ''tiny_tds'', ''= 0.6.2'' require ''tiny_tds'' gem ''activerecord'', ''= 3.2.12'' require
2009 Feb 03
3
ROXML from_xml not returning an object instance...
Hello, I have two ActiveRecord classes. One is Route the other is Waypoints. I have constructed an XML representation so I can use AJAX to create a Route with all waypoints in a single create call to RouteController. When I call Route.from_xml(xmlString) it is not returning an object - it''s leaving the object (@route) nil, but not erroring. Any ideas? Here''s some code:
2012 May 04
7
Unable to Install ruby-odbc gem on windows 2008 server bit
Hi, I am trying to install the ruby-odbc gem on windows 2008 server Enterprise SP2 64 bit version I have installed the devkit for ruby and it is also getting installed. When trying to install this ruby-odbc gem some how make.exe file is getting crashing and I am unable to install it further. I am able to install the same gem on a 32 bit machine but the same procedure does not work out on 64
2012 Jan 02
4
Which AR Interfaces Leverage PreparedStatements/Binds?
I could not find the answer to this in a few Google searches and thought I would ask. So when are prepared statements best leveraged in ActiveRecord''s interface? I never really noticed before, but simple condition hashes or scopes do not pass down the binds so that prepared statements are leveraged. So a `Car.find(1)` would but things like `Car.where(:id => 1).first` do not. Is it a
2006 Jul 24
3
how to install busy_handler for SQLite3
I get too often SQLite3::BusyException and after searching a bit I think I''d need to install a busy_hanlder to return true. That seems to be per connection, how would you do this in a global way in Rails? -- fxn
2017 Oct 02
2
[EXT] Should we switch to --hash-style=both by default in LLD ?
Le 2 oct. 2017 à 18:37, Rui Ueyama <ruiu at google.com<mailto:ruiu at google.com>> a écrit : Changing default to "both" is probably fine, but what does that change actually mean in practice? I believe clang already passes --hash-style=both to the linker by default. Not exactly. The current Linux driver (I haven't checked other ELF-based systems) reads this
2010 Dec 06
15
Windows new installation - Always problems
I would like to know if there is a way to ''package'' an application with all the associated gems and ship it to a new server and having it to "just work" in a Windows environment. Although I have never done it I know that Rails can be frozen into the application. I am wondering if I can do the same thing with other gems. I have found this
2017 Oct 02
2
Should we switch to --hash-style=both by default in LLD ?
+1 for both table formats. Then we're compatible by default no matter what. If somebody cares about .o file size, they can explicitly specify their --hash-style. On Mon, Oct 2, 2017 at 5:35 AM, George Rimar via llvm-dev < llvm-dev at lists.llvm.org> wrote: > >> Le 2 oct. 2017 à 14:23, George Rimar <grimar at accesssoftek.com> a écrit > : > >> > >> I
2006 Dec 10
2
set specific date with date_select
Hi All I seem to have a problem with date_select methods. I cannot set a default date. I tried the following: <%= date_select( "post", "written_on", :selected => Date.new(2005,3,31), :order => [:day, :month, :year] ) %> But still I get todays date :( Any suggestions what I do wrong here ? Thnx a lot LuCa -- Posted via http://www.ruby-forum.com/.
2011 Jan 04
1
Problem with "date_select" form helper
Hi, I am using "date_select" form helper to select the date. My code is as follows:- <%=date_select("post", "written_on", :prompt => { :day => ''Select day'', :month => ''Select month''}, :discard_year=>true)%> It works. But there is problem with the number of days for each month. The days combobox has populated with
2006 Mar 02
1
PostgreSQL function in an insert statement
Hi there, I wont insert a picture in a PostgrSQL-DB via the function lo_import. Therfore I modify the value of an ''oid'' column. @measurepoint = Measurepoint.new(params[:measurepoint]) @measurepoint.measurepoint_background = "lo_import(''#{@params[''measurepoint''][''measurepoint_background'']'')" @measurepoint.save The
2012 Apr 10
4
TinyTds::Client.new() gives an error "undefined symbol: dbsetluser"
Hello Dear experts, I am new to Ruby on Rails. Though I want to access to MSSQL 2005 from ruby. I installed tiny_tds using following commands: >sudo apt-get install freetds-dev >gem install tiny_tds And now when I executed @client = TinyTds::Client.new( :username => ''username'', :password => ''password'', :host =>
2005 May 08
3
Overriding date_select in local project to use custom value rather than blank for starting option...
I would like to have a date control on a page and I would like a behavior similar to what you get using date_select with the :include_blank => true option where the first value in the dropdown is "- Month -", "- Day -", or "- Year -" rather than a blank value for the respective month, day, and year select fields. I took a look at the ruby source for
2012 Jan 11
4
ActiveRecord: ar-each_model
Hi, today I went into a problem, when I had to iterate over a big result set. ActiveRecord produces a huge array of model instances, which consumed 1GB of memory on my machine. A comparable perl DBI script only used some KB for iterating over the result set. Then I was suggested to use batch (#find_each) for the problem. But basically batch does the same thing by splitting the query into several
2005 Sep 13
5
acts_as_taggable 1.0.4 now gemified!
Hi Folks, The acts_as_taggable mixin is now available as a shiny gem. More details here: http://dema.ruby.com.br/articles/2005/09/13/acts-as-taggable-gemified This release features some cool additions as well. Cheers Dema -- http://dema.ruby.com.br - Rails from a .NET perspective
2005 Dec 22
2
nonstandard postgresql sequence names
I''m working with a legacy postgresql database where the names of tables, columns, etc., do not usually follow Rails conventions. I''ve been able to work around it for the most part, but I ran into this: I have the following test: require File.dirname(__FILE__) + ''/../test_helper'' class SponsorTest < Test::Unit::TestCase self.use_transactional_fixtures =
2006 Oct 15
3
Migrations - add_column :default=>true, :null=>false
This seems pretty brain dead: add_column :types, :notify_on_create, :boolean, {:default=>true, :null=>false} $ rake migrate Error: ERROR: column "notify_on_create" contains null values : ALTER TABLE types ALTER notify_on_create SET NOT NULL Why doesn''t Rails set the new column to true, as it''s supposed to default to? I tried :default=>1 as well (same
2005 Apr 23
2
[Tip] Introspection to determine if a column may be null
I still want to get this into Rails for all connection adaptors, but for now I''ve hacked my own addition on for just PostgreSQL. The following code extends every Column object returned by MyModel.columns to support a new #required? method, which indicates if the column may or may not be null. The following is a huge hack - suggestions on a cleaner way to add this functionality
2006 Feb 19
2
possible rails -> postgresql bug
Hi I have a problem accessing an array field in a Postgresql database. Here is the table definition. View "neil.flashing_codes" Column | Type | Modifiers -------------+-----------------------+----------- code | character varying(10) | description | text | folds | integer[] | View definition: SELECT
2006 Jan 13
1
How to disconnect to a database????
Hi, We have experienced some problems with ActiveRecord::Base class of Ruby-Rails. We are building a web-application based on the Ruby-rails framework and the web-application needs to access to difference databases, so we do not pre-define our database accesses in the database.yml file. In fact, we are using the ActiveRecord::Base.establish_connection() to connect to our database, the function