Comments (5)
You're totally right! I can't really remember why I used attribute_names
when it definitely should be column_names
, but I believe that ActiveRecord Attributes API was pretty new thing these days (almost 5 years ago!).
Released evil-seed 0.2.0, please try it!
Thank you!
from evil-seed.
Can you please tell a bit about your actual database schema? I suppose that name
column is actually in some different translations table, right?
Also please tell ActiveRecord and globalize versions you're using. Thanks!
from evil-seed.
Yup exactly.
The gems versions are:
globalize (5.3.1)
globalize-accessors (0.3.0)
i18n (1.8.10)
activerecord (= 5.2.6)
The schema is composed by the table person
and person_translations
that has a foreign key person_id
, the locale
and the name
.
Thank you for being so quick!
from evil-seed.
From what I understood, this problem is related to the fetch_attributes
, which uses the model_class.attribute_names
method, and this method returns the column names plus some attributes that are not in the table. I'm not sure if that is what is pretended, but I found out that we can use column_names
instead and this returns only the columns in the table.
I'm not sure if this helps or not, but either this or an option to ignore attributes would improve the gem I think!
from evil-seed.
Looks good! I'll bring you feedback later, thank you so much for your quickness!
EDIT: Everything is working nicely, thank you!
from evil-seed.
Related Issues (12)
- Foreign key nullification HOT 3
- What would be the best way to anonymize specific attributes in a JSONB column HOT 3
- Ignore generated columns HOT 2
- Model with ActiveStorage attachment can't be anonymized HOT 3
- Errno::EMFILE: Too many open files @ rb_sysopen
- Recursive execution? HOT 4
- Support for Foreign Key attribute on belongs_to HOT 1
- Please provide a full example for non ruby developper HOT 2
- Rails 4.2.x and jruby compatibility HOT 5
- Invalid SQL order by clause from root model configuration HOT 1
- Excluding tables HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from evil-seed.