Git Product home page Git Product logo

Comments (5)

Envek avatar Envek commented on July 28, 2024 1

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.

Envek avatar Envek commented on July 28, 2024

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.

masterzeus05 avatar masterzeus05 commented on July 28, 2024

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.

masterzeus05 avatar masterzeus05 commented on July 28, 2024

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.

masterzeus05 avatar masterzeus05 commented on July 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.