Displaying 20 results from an estimated 5000 matches similar to: "Is there a way to persist a Hash in ActiveRecord?"
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 {
2006 Apr 14
1
CLOB handling in ActiveRecord 1.14.2
We recently switched to Rails 1.1.2, which includes the latest version
of ActiveRecord.
This version seems to have introduced an error with the handling of
non-binary large objects.
The OCI adapter in 1.13.2 seemed to have treated CLOB and BLOB
identically. The new Oracle adapter distinguishes between the two types
and gives CLOB a type of :text, where as BLOB are :binary
When it comes to
2006 May 17
6
ActiveRecord#to_param
Hello,
to implement some some kind of optimistic locking, I want to build a
view, where an object is displayed together with a link containing the
data of the displayed object. My first try looked something like
<%= object.object_discription %>
<%= link_to "action", :action => "take_action", :data => object %>
this won''t work because object is of
2009 Mar 17
4
Preventing a submitted hash from ActiveRecord DB store
Hi all,
I have a multi model form (Project with many tasks) and I want to
prevent a task from being saved to the DB if it is empty ie. if there
is no i/p for that task from the user. I tried the following
class Task < ActiveRecord::Base
before_save :check_if_empty
...
def check_if_empty
self.destroy if description.blank?
end
but i get this
TypeError in ProjectsController#create
2008 Jan 04
2
oracle adapter + activerecord sessions do not work
Anyone know what''s up with the activerecord session store when using
the oracle adapter in Rails 2.0.2 ?
I can set a session variable and can then see it''s actually set using
the debugger, but after the request completes the session is empty
(the @data member is nil). The session_id is staying the same and the
updated_at field is being updated but nothing I put in a session
2007 Jun 27
3
acts_as_tree and before_save
We all know that acts_as_tree gives us ability to set up data in a
tree-like structure and use methods like ''parent'', ''children'' and so on.
Something I''m completely stuck on. Observe.
class Page < ActiveRecord::Base
acts_as_tree
def before_save
raise self.parent.to_yaml
end
end
Well, you''d think that it should show
2007 Mar 21
2
ORA-03106: fatal two-task communication protocol error
Has anyone encountered this error or know how to correct it?
I couldn''t find any Rails-specific info about this on google.
Here are the circumstances:
/usr/local/bin/ruby --version
ruby 1.8.4 (2005-12-24) [i686-linux]
/usr/local/bin/rails --version
Rails 1.1.6
## Create mcd app
rails mcd -d oracle
cd mcd
## Create oracle tablespace & user
sqlplus ''/ as
2008 May 19
20
[PATCH 00/23] ia64/xen domU take 6
Hi. This patchset implements ia64/xen domU support based on
ia64/pv_ops frame work which was sent as another patchest.
Changes from take 5 are rebased to Linux 2.6.26-rc3,
bug fix ivt.S paravirtualization and multi entry point support.
I believe these patches can be applied to the linux ia64 repository.
This patchset does the followings.
- Some preparation work. Mainly importing header files to
2008 May 19
20
[PATCH 00/23] ia64/xen domU take 6
Hi. This patchset implements ia64/xen domU support based on
ia64/pv_ops frame work which was sent as another patchest.
Changes from take 5 are rebased to Linux 2.6.26-rc3,
bug fix ivt.S paravirtualization and multi entry point support.
I believe these patches can be applied to the linux ia64 repository.
This patchset does the followings.
- Some preparation work. Mainly importing header files to
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:
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,
2008 Oct 14
32
[PATCH 00/32] ia64/xen domU take 11
This patchset is ia64/xen domU patch take 11.
Tony, please commit those patches.
They are ready to commit because all the issues which were pointed out
had been addressed and got enough reviews.
This patchset does the followings.
- Some preparation work. Mainly importing header files to define
related structures.
- Then, define functions related to hypercall which is the way to
communicate
2008 Oct 14
32
[PATCH 00/32] ia64/xen domU take 11
This patchset is ia64/xen domU patch take 11.
Tony, please commit those patches.
They are ready to commit because all the issues which were pointed out
had been addressed and got enough reviews.
This patchset does the followings.
- Some preparation work. Mainly importing header files to define
related structures.
- Then, define functions related to hypercall which is the way to
communicate
2008 Oct 17
34
[PATCH 00/33] ia64/xen domU take 12
This patchset is ia64/xen domU patch take 12.
Tony, please commit those patches.
They are ready to commit because all the issues which were pointed out
had been addressed and got enough reviews.
This patchset does the followings.
- Some preparation work. Mainly importing header files to define
related structures.
- Then, define functions related to hypercall which is the way to
communicate
2008 Oct 17
34
[PATCH 00/33] ia64/xen domU take 12
This patchset is ia64/xen domU patch take 12.
Tony, please commit those patches.
They are ready to commit because all the issues which were pointed out
had been addressed and got enough reviews.
This patchset does the followings.
- Some preparation work. Mainly importing header files to define
related structures.
- Then, define functions related to hypercall which is the way to
communicate
2008 Feb 26
8
[PATCH 0/8] RFC: ia64/xen TAKE 2: paravirtualization of hand written assembly code
Hi. I rewrote the patch according to the comments. I adopted generating
in-place code because it looks the quickest way.
The point Eddie wanted to discuss is how to generate code and its ABI.
i.e. in-place generating v.s. direct jump v.s. indirect function call
Indirect function call doesn't make sense because ivt.S is compiled
multi times. And it is up to pv instances to choose in-place
2008 Feb 26
8
[PATCH 0/8] RFC: ia64/xen TAKE 2: paravirtualization of hand written assembly code
Hi. I rewrote the patch according to the comments. I adopted generating
in-place code because it looks the quickest way.
The point Eddie wanted to discuss is how to generate code and its ABI.
i.e. in-place generating v.s. direct jump v.s. indirect function call
Indirect function call doesn't make sense because ivt.S is compiled
multi times. And it is up to pv instances to choose in-place
2006 Apr 20
5
Mystified by ActiveRecord.serialize
I''m either missing a step, confused or seeing some odd behavior with
ActiveRecord''s serialize feature. When I load an ActiveRecord object
from the database, my serialized attribute is a YAML::Object, not the
original object. My code is based on an example of this capability in
the "Agile Web Dev. w/ Rails" book (p. 196).
In create.sql:
<code>
create table
2008 Aug 26
30
[PATCH 00/30] ia64/xen domU take 10
This patchset is ia64/xen domU patch take 10 which is rebased
to 2.6.27-rc4.
This patchset implements ia64/xen domU support based on ia64/pv_ops
frame work which was sent as another patchest.
This patchset does the followings.
- Some preparation work. Mainly importing header files to define
related structures.
- Then, define functions related to hypercall which is the way to
communicate with
2008 Aug 26
30
[PATCH 00/30] ia64/xen domU take 10
This patchset is ia64/xen domU patch take 10 which is rebased
to 2.6.27-rc4.
This patchset implements ia64/xen domU support based on ia64/pv_ops
frame work which was sent as another patchest.
This patchset does the followings.
- Some preparation work. Mainly importing header files to define
related structures.
- Then, define functions related to hypercall which is the way to
communicate with