similar to: Question/possible bug on ActiveRecord serialize and STI

Displaying 20 results from an estimated 5000 matches similar to: "Question/possible bug on ActiveRecord serialize and STI"

2011 Mar 09
1
ActiveRecord serialize method not returning YAML array in test environment.
Hello, I''ve got a problem with deserialization of AR "serialize" method (http://apidock.com/rails/ActiveRecord/Base/serialize/class) in my tests. It just gives me pure String instead of my data Array. Example: User > AR::Base serialize :roles, Array end Console: u = User.new u.roles = ["admin", "support"] u.save # => true User.first.roles # =>
2006 Aug 05
0
STI or Serialize attributes to one column?
I''m considering serializing attributes of extended classes to one column instead of using STI. Each of the extended classes will have associated views to render the UI based on the serialized params. The references to the associated views will be stored in the model. I don''t need to query the params. I''d like to hear about any pitfalls and experiences of others who may
2020 Jan 13
4
Adding SNI support to SSH
Christian Weisgerber <naddy at mips.inka.de> writes: > On 2020-01-12, Dustin Lundquist <dustin at null-ptr.net> wrote: > >> I think the intended application is to proxy through a proxy host provided by the service provider. If SSH had a SNI like feature where a host identifier was passed in plain text during the initial connection. This way the user would just need to
2006 Mar 22
3
STI and ActiveRecord attributes unprotected
Hi, This does not seem to be covered anywhere. Since base class extends ActiveRecord with a table that has fields for all heirs, would that mean that any heir class can access any of those attributes, including ones that belong to other heirs? Or I am missing something? -- Posted via http://www.ruby-forum.com/.
2010 Apr 29
0
Precision issue with date parsing in ActiveRecord
Hello all, I just recently opened supplied a patch for ticket #4498 (https:// rails.lighthouseapp.com/projects/8994/tickets/4498-rails-loses- precision-when-deserializing-timestamps-from-postgresql). In short, the current microsecond calculation converts a rational to a float, then to an integer, occasionally causing rounding error. I''ve supplied a patch against 2-3-stable (should also
2020 Jan 12
2
Adding SNI support to SSH
> Have you ever considered using ssh's proxy-command for this? > I have a similar setup, works great for me. I think the intended application is to proxy through a proxy host provided by the service provider. If SSH had a SNI like feature where a host identifier was passed in plain text during the initial connection. This way the user would just need to register their host identifier
2008 Jan 27
0
Using acts_as_list, acts_as_tree, and STI in one model
Check it out y''all: http://rafb.net/p/NJg5U147.html (pastie was down) I''m trying to make a tree which belongs_to another model, where you can have sections or items as children, and sections can have sections or items as well. Moreover, any siblings should be sortable. For instance: Root - Section 1 - - Item A - - Item B - Item C - Section 2 - - Item D - - Section 3 - - - Item
2007 Dec 13
2
Trying to use ActiveRecord STI but fails
Hi all, I''m wondering about my sanity here. There''s probably something simple I overlooked. First off, I have close to zero experience with Merb. 1. I configured use_orm :activerecord in config/dependencies.rb; 2. I have a file named app/models/measurement.rb which looks like this: class Measurement < Observation end 3. I have another file named
2011 Mar 06
3
HABTM Association with STI model
Is there a better way to do this? It looks really ugly! http://pastie.org/1640550 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to
2000 Nov 30
5
jpeg in R for Windows?
I have tried to put graphs in jpeg files, but even if a file is produced, neither the graphics software nor the web browser can open such a file: "Can't read file header". Any suggestions as to what might cause this? BTW, the output would presumably be better as png files, but I don't really know if I can count on my students' web browsers being able to read this format.
2024 May 01
2
De-serialization vulnerability?
All, There seems to be a hullaboo about a vulnerability in R when deserializing untrusted data: https://hiddenlayer.com/research/r-bitrary-code-execution https://nvd.nist.gov/vuln/detail/CVE-2024-27322 https://www.kb.cert.org/vuls/id/238194 Apparently a fix was made for R 4.4.0, but I see no mention of it in the changes report: https://cloud.r-project.org/bin/windows/base/NEWS.R-4.4.0.html
2006 Aug 11
0
serializing / deserializing active records with children
What is the best approach to serialize / deserialize full blown active record objects with multiple child objects (one-to-many relations). YAML::load(), YAML::dump() almost work :) -> loaded object has children (I see them in breakpoint session: "puts parent"), but when I am accessing children (e.g: "puts parent.emails") array becomes cleared - I guess rails are trying to
2010 Dec 08
0
ActiveRecord serialize field and SerializationTypeMismatch
Hello. In one of my ActiveRecord models I specified a a serialize field: serialize :settings MyModelSettings If I understand the documentation correctly this restricts settings to the class MyModelSettings. The problem is that this is so restrictive that I even don''t know how to initialize the field. MyModel.new or even MyModel.new(:settings => MyModelSettings) everything I do
2008 May 05
0
Changing ActiveRecord serialize format to XML instead of YML
Hello, So far, ActiveRecord serialize is working great for me to save arbitrary data. I would like to know if there is a way to change the format of ActiveRecord serialize to XML instead of YML. I like the readability of YML, but I need to search serialized fields in the database. So, it would make sense to use XML because most database vendors supports XML value extraction, e.g,. ExtractValue
2010 Feb 08
1
Model using STI new function only working partially
Hi, I have an application using STI on a model named Publisher. Publisher uses STI via a column named "service". When I call -- p = Publisher.new(..., :service => "TwitterPublisher") -- the service does not get assigned, yet all other columns do. However, if I later call -- p[:service] = "TwitterPublisher" -- all is well. Any ideas about what is going on? My
2006 May 10
2
Exploring ActiveRecord::Base#serialize
Hi I was recently taught about the useful ActiveRecord::Base#serialize. It''s very useful for persisting arbitrary objects through the regular database. For example, say you want to store a Set of all the years a Convention took place. You do: class Convention < ActiveRecord::Base serialize :years, Set end This effectively creates a Convention#years attribute, which is a set: you
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
2006 Dec 11
4
Holding an ActiveRecord object for later use.
This is probably a noob question.. I have a fairly large query (the result takes along time to return) that I need to export to CSV after it is displayed with a view. Basically a link at the bottom of the page, "Export to CSV". I''ve found the rails wiki solution: http://wiki.rubyonrails.com/rails/pages/HowtoExportDataAsCSV . The only problem is that I would like to have this
2014 Jul 08
2
[LLVMdev] Continuing PR5680: preserve order of use lists in bitcode
I'm looking to tackle PR5680 [1]. The primary goal is to prevent behaviour changes in passes that depend on the order of use lists when serializing/deserializing the IR to a bitcode file (.bc) between passes. Here's a quick high-level summary: - When writing bitcode, calculate what the use list order will be after reading the bitcode. (Assumption: the order is predictable.) -
2006 May 02
0
YAML failing to de-serialize
I''m seeing this same problem that Josh was seeing back on March 23rd (see below) I''ve got the following YAML snippet stored in a text field: "--- !ruby/object:FieldValue \nattributes: \n item_id: 60\n title: Test\n field_id: 15\n created_by_id: 5\n locale: en\n link: www.cclearn.com\n comment: this is a test\n created_at: 2006-05-02 15:43:14.256792 Z\nnew_record: