Displaying 20 results from an estimated 130 matches similar to: "Serialized object behaves weird"
2006 Jul 11
8
Stop updated_at from auto updating?
Hi
Is there any way to temporarily stop the updated_at field from being
updated when a record is modified with ActiveRecord?
I have a date field which is keeping track of when the record data was
last checked by my application and my app manually updates it, of course
when I do this the updated_at field is also touched making it fairly
useless for finding out when the actual data was changed
2012 Oct 23
7
Not updating the updated_at field
This is for Rails 3.1.1
I have a field called last_seen in a model. This field will be updated
when the something about the record is seen in the real world (don''t
worry about this part)
So I go x.update_attribute(:last_seen, Time.now) and the following happens is
UPDATE "blah" SET "last_seen" = ''2012-10-23 08:57:46.179288'',
"updated_at"
2007 Sep 05
8
Hi..Guys new plugin again
Hi..
Guys new plugin again
Foreign Key Associations is a plugin that automatically creates
associations based on foreign-keys. The associations are created at
runtime-ie. as your ActiveRecord models are loaded-so they will always
be up-to-date.
For example, given a foreign-key from a customer_id column in an
orders table to an id column in a customers table, the plugin
creates:
2008 Jul 05
4
one db - many rails projects -> many schema_migrations table
Hi all!
How can I change the name of the schema_migrations table? I have to do
this because I can only use one database but want to have several rails
projects.
I hope this is possible at all.
greets
flo schaf
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on
2006 May 10
13
Issue in ActiveRecord generated reader methods
Hi all!
I have come into a strange issue in Rails that I am hoping someone
can shed some light.
To make a very long story short, I have been researching how to
override ActiveRecord::Base#read_attribute and write_attribute to
perform security checks at the model level (influenced by the
ModelSecurity generator). Shortly after implementing some code to
check this behavior, I began to
2006 Jul 07
5
link_to: link is missing id
I''m using a legacy table, where the unique id is not ''id''
I have a Model class like the following:
class Article < ActiveRecord::Base
set_primary_key "ARTICLE_ID"
end
however, using a link_to like the following (modified scaffolding),
the link has no id value:
<% for article in @articles %>
<tr>
<% for column in
2007 Dec 14
0
combobox and m:n relation
Hi,
i have a project and a task. both have a m:n relation to each other. I
made a scaffolding and want to insert a combobox in the task new view
Code : ruby - fold - unfold
<label for="project_name_ger">Poject</label><br/>
<%= select "task[projects_id][]", "project_id",
Project.find(:all).collect {|c| [c.name_ger,
2003 Nov 06
0
Transfer of files
I am sending files from a 4.1.X SunOs machine to a Sun-Fire Solaris 8 with
D-2 in an attempt to upgrade our systems. I moved 0ne f/s successfully
containing ~ 450 M. I am now trying to move a file system of ~ 6 G. I get
the output of make_list and expand file_list to 4000 bytes. It shows the
moving of approx 4000 files but none are moved and the sending machine stops
at the same file each
2006 Apr 10
0
Inheriting data from one model to another
Hello
I''ve been struggling with something for hours that I thought would be
a simple job. Hopefully somebody can shed some light on what I''m
trying to do :o)
First of all I''ll explain what I''m trying to achieve. In a store
application I want to have products and product variations. A product
variation should inherit all of its properties from product unless
2006 Jul 09
2
serialized DateTime objects returning as Time objects
I have a database field called dates in which I am trying to serialize an
array of DateTime objects. When I unserialize them, they are coming back
in as Time objects. I know this, because I am getting errors that say
"comparison between Time and DateTime failed.
Why is this happening? Is there a way to prevent it??
Thanks Shelby
-------------- next part --------------
An HTML attachment
2008 Jun 03
0
Editing a serialized hash with a Rails form
I used the "serialize" class method on one of my models to save a hash
in my database. It works fine, but now I would like an easy way to edit
the hash with a form.
I tried to make some googling, but I didn''t find anything about it.
How is this done easily?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this
2008 Jul 26
0
fixtures, how to set a serialized Hash object
I defined in my model :
...
serialize :unavailables
..
which is set like this (Hash : "year" => 2-dimensional Array)
{"2008" => Array.new(13).map!{ Array.new(32, 1)} }
In my fixture I need to initiliaze this field with the following
hash :
{"2008" => Array.new(4).map!{ Array.new(32, 1)} + Array.new(1).map!
{ [1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2009 Oct 13
0
Re: How can I parse encoded and serialized XML with REXML?
Not really a solution, but this has to be a classic example of PHP-
programmer-bass-ackwardness. They''re already writing to an extensible
serialization format (XML) but then just whack language-specific
serialized data in instead. That''s right up there with the HTTP-over-
SOAP-over-HTTP stuff I''ve seen floating around...
--Matt Jones
On Sep 24, 9:14 am, Andy
2009 Feb 01
1
activerecord access raw serialized data
Hi,
I have a model with a serialized field ''other_data''.
How can I add raw YAML data to that field?
If i try:
model[other_data] = yaml_formatted_data
yaml_formatted_data gets YAML formatted again.
--
cheers,
M.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
2009 Apr 29
0
XML Builder - problems with serialized ruby
Hi,
I''m using the Builder gem to transform an array/hash that contains
serialized ruby. Builder''s to_xs method seems to mangle serialized
ruby though. I can get around this by encoding/decoding with base 64,
but that doesn''t seem like a good path to follow.
Builder is using this code for escaping: http://intertwingly.net/stories/2005/09/28/xchar.rb
Any ideas on how to
2007 Jul 06
0
Removing One Element From a Serialized Form
Hi all,
I''m trying to serialize a form with the exception of one specific
element.
Serializing the form in a hash (without pulling out specific elements)
works:
<li>
<%= link_to_remote ''(Save)'', {:url => post_path(@post), :with => "$
(''post_form'').serialize(true)" }, :method => :put %>
</li>
The generated code
2010 Jul 05
0
Serialized JSON object importation
Hi,
I would like to import a serialized object (from a JSON export) inside
my database.
It work fine if for instance I do:
>> l = Yea.create(:title => "foo bar")
=> #<Yea id: 3, title: "foo bar", created_at: "2010-07-05 21:44:54",
updated_at: "2010-07-05 21:44:54">
>> j = l.to_json
=>
2006 Apr 21
0
Questions on version arg to setClass and serialized instances
I have a few questions and thoughts regarding class versioning and
serialized S4 class instances.
How is the version argument to setClass is intended to work? It
appears to want an externalptr, but that seems odd to me.
setClass("FOO", representation(x="numeric"), version="1.2.3")
Error in validObject(.Object) : invalid class
2007 Sep 01
1
serialized plot object (for a certain device)
Dear list,
Using serialize it is possible to save
the binary string representing an R
object to a raw R vector.
## adapted from ?serialize
x <- serialize(list(1,2,3), NULL)
x
I am looking for a way to capture
the binary string that in normal
use of graphics devices will be
written to (most commonly) a file
connection.
jpeg(file = "test.jpg")
plot(1:10)
dev.off()
In other
2009 Nov 22
1
serialized plot object (2 years later)
About 2 years ago, Tobias Verbeke asked:
"I am looking for a way to capture the binary string that in normal use of graphics devices will bewritten to (most commonly) a file connection... Is there a way of capturing the binary `jpeg string'
[generated by jpeg()]?"
http://tolstoy.newcastle.edu.au/R/e2/devel/07/09/4276.html
Brian Ripley's answer was "Nope, unfortunately,