-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#write_lobs should always serialize attributes #2200
Comments
Hi @akostadinov I'm using fluentd and oracle enhanced plugin, and I have NCLOB & CLOB type of column, the data pushed from fluentd to Oracle for this column is always blank, in fact, it doesn't work of NCLOB, it complains empty NCLOB, do we need some settings for these types datatypes in order to work ?? Oracle : 18c version |
@harsh288 , I think this is a different issue. Does your backtrace point back at In my project we quote |
Sorry @akostadinov, I know you are looking for some solution and I 'm here asking for a help, I 'm not sure how to resolve this issue in fluentd, below is the configuration that I have done.
|
@harsh288 , not a fluentd expert. Perhaps try to find support in fluentd community. |
#write_lobs only serializes attribute before writing to the database when it is
ActiveRecord::Type::Serialized
. Thenvalue.to_s
is written to the database ignoring ActiveRecord type serialization method.Attributes should always be serialized before writing to the database. I don't see how custom attributes are supposed to be used otherwise.
A workaround for this would be to define
#to_s
of the custom attribute which does the same as serialization to database, but this is not often undesirable.I tested with 1.7 as stated at the bottom but I see same logic used in master too.
Steps to reproduce
class MyCustomAttribute < ActiveRecord::Type::Text
Expected behavior
Basically everything works as if
ActiveRecord::Type::Text
has been used.Actual behavior
System configuration
Rails version: 5.0.7.2
Oracle enhanced adapter version: activerecord-oracle_enhanced-adapter (1.7.11)
Ruby version: ruby 2.5.9p229bu
Oracle Database version: oracle:19.3.0
The text was updated successfully, but these errors were encountered: