similar to: detecting width overflow in serialized column with mysql

Displaying 20 results from an estimated 1000 matches similar to: "detecting width overflow in serialized column with mysql"

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/.
2008 Dec 20
9
Upgrade to Rails 2 - problem with "save" (MySQL boolean issue?)
I have been working through an upgrade of my 1.2.6 application to 2.2.2. I am almost there but I have hit a problem with ActiveRecord. Before the upgrade, the following code was working fine. def create_root(administrator) root = create_root_collection(self.pingee_name, administrator,
2007 Oct 07
1
How to store a Mechanize object in the database?
Hi, I am trying to save a Mechanize object in database (using a Rails Model). But the save operation throws a TypeError Considering that "agent" is an instance of a Rails Model and "user" is defined as a "text" type in the Model. irb(main):039:0> agent.user = WWW::Mechanize.new #<WWW::Mechanize:0xb71295f0 @follow_meta_refresh=false, @key=nil,
2006 Oct 19
3
Selecting datetime values from SQL Server (year < 1970)
All, Rails 1.1.6. Any AR find() call that generates a SELECT * type query against a table with a DATETIME column in SQL Server whose value occurs before 1970 will fail, because of the coercion of SQL Server datetime types to Time values in Ruby. See sqlserver_adapter.rb line 490 (record[col] = record[col].to_time if record[col].is_a? DBI::Timestamp) If I remove the coercion (just commenting
2010 Jul 17
1
not able to find to_yaml definition
I am looking at rails edge source code. I am able to do puts User.find.to_yaml However I am not able to find piece of code where ''def to_yaml'' is. How this to_yaml serialization is working? can fully understand how to_json and to_xml is working but to_yaml beats me. Thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2008 Mar 31
14
To surf to URL mydomain.com instead of mydomain.com:3000?
My production server is using mongrel_rails on Ubuntu linux. With Firefox I can reach my production server with the URL: www.mydomain.com:3000/ but I can''t reach my production server with the URL www.mydomain.com/ Is there a way to configure mongrel so that I can reach my production server with the URL www.mydomain.com? -- Posted via http://www.ruby-forum.com/.
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
2009 Jan 07
13
HTTP parse error due to an extra percent sign
If you append an extra percent sign to a URL that gets passed to mongrel, it will return a Bad Request error. Kind of odd that "http://localhost/%" causes a "Bad Request" instead of a "Not Found" error. Here is the error from the mongrel log: HTTP parse error, malformed request (127.0.0.1): #<Mongrel::HttpParserError: Invalid HTTP format, parsing fails.>
2008 Nov 06
10
Rails 2.1.2 bug in include on has_many?
In my continued efforts to port my rails 1.x app to Rails 2.1.2, I keep running into what appear to be ActiveRecord bugs. I am using an :include on a :has_many definition: class Request < ActiveRecord::Base has_many :service_types, :order=>''service_types.id ASC'', :include=>:service_response [...] There''s no reason this wouldn''t be supported in
2007 Apr 22
1
names( d$columnname )
dear R wizards --- would it make sense for names(d$columnname) to be "columnname"? I can preserve the columnname through x=subset(dataset, select="columnname"), of course, but it would seem that x=d$columnname could also do this. No? Sincerely, /iaw
2011 Jul 27
1
Referencing a column using a function argument
Hi all, I've been having trouble with something that seems like it should be fairly straight forward. Any help at all from more experienced users is appreciated! I'd like to write a function that uses a column name as an argument. However, I run into problems when I try to reference this column within the function. For example, findCutoff <- function(tableName, columnName) {
2010 Jul 26
4
using string variable as order() function argument
Hello, In my script I would like to use a loop, which sorts the dataframe according to different columns, pointed by the string variable. id col1 col2 col3 1 10 0 4 8 2 11 1 2 2 3 12 0 8 3 4 13 0 5 5 Usually the order() function can be used like this: sorted = mytable**[order(column3) , ] which results in properly sorted table: **
2009 Jun 25
2
variable driven summary of one column
Hello, how can I get a variable driven summary of one column of my data.frame? Usually I would do > summary(data$columnname) to get a summary of column named "columnname" of my data.frame named "data". In my case the columnname is not static but can be set dynamically. So I save the chosen columname in something like variable <- "columnname" but how can I
2009 Oct 14
18
sybase in rails2?
Has anyone actually gotten the activerecord-sybase-adapter to work in Rails2? I can''t seem to, and can''t figure out why. I am on RedHat linux. I have the sybase client libraries installed, I have the adapter installed. After installing the patch at https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2455-update-for-sybase_adapter#ticket-2455-4 to get a slightly
2012 Jan 13
2
question: how to select a column from a dataframe in a function
Hi, I am creating a function and ran into the problem of selecting a column from a dataset. It seems as though the $ function (as in data$columnname) does not apply in the function. In simplified version: This works: testf2<-function(data,columnnumber){print(data[,columnnumber])} But this doesn't: testf<-function(data,column){print(data$column)} Even though the first solution works,
2012 Jul 05
1
hash to_yaml in erb template not giving valid yaml
Hi, I want to use a file resource to write a facts.yaml file for Mcollective. For some reason it won''t provide a valid yaml format if I dump my scope to hash and convert to_yaml. file { "/etc/mcollective/facts.yaml" : owner => root, group => root, mode => 400, loglevel => debug, #content => inline_template("<%= scope.to_hash.reject {
2009 Apr 20
11
manual access to session data outside of request?
So, given a sessionID, I have need to read and write the session stored information ''manually'', from _outside_ an actual Rails request/controller. Readers, I know your first response may be to tell me I don''t really want to do that. Trust me though, I really do, it makes sense for me in my case. I know this wouldn''t work if you''re using the new cookie
2012 Aug 07
2
What is this called? lapply(datum,"[[","ColumnName")
Hello R users I recently learned how to use this command: lapply(datum,"[[","ColumnName") Unfortunately, I don't know how exactly it works, what it's called (in particular the "[[" part], and what other things you can do with it (retrieve multiple columns?). Given datum is a list of dataframes with the same column, but different number of rows,
2007 Nov 14
1
has_many_polymorphs and acts_as_list ?
First, BRAVO for this wonderful plugin: has_many_polymorphs ! Now my problem: 4 models : Collection, Page, Fragment, Belonging (which is the join table): 1 class Collection < ActiveRecord::Base 2 has_many_polymorphs :elements, 3 :through => :belongings, 4 :from => [:pages, :fragments, :collections], 5 :as => :collector, 6 :parent_order =>
2006 Aug 17
2
how to check if the value is repeated?
hi! as the subject says, :P how can i check if a value is already in a table?? ty!! -- Posted via http://www.ruby-forum.com/.