Skip to content
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

Support for database #47

Open
pinkynrg opened this issue Aug 3, 2017 · 1 comment
Open

Support for database #47

pinkynrg opened this issue Aug 3, 2017 · 1 comment

Comments

@pinkynrg
Copy link

pinkynrg commented Aug 3, 2017

So this is not an issue, it is more a question. I was thinking about modifying this library so that instead of having a config file to load data from a file I would have all configurations from the db for my rails application.

This would be beneficial for a few reasons:

  1. I can modify/delete any unit runtime.
  2. I can add "functional" units without the need to write new code or make new commits.

Do you think it would be an incredible pain for me to try achieving the above?

@pinkynrg pinkynrg changed the title Configuration file on db Support for database Aug 8, 2017
@pinkynrg
Copy link
Author

pinkynrg commented Aug 8, 2017

I tried to patch this awesome gem to make it work with the database:

https://github.com/pinkynrg/unitize

So basically I used this gem's engine without preloading any atoms (initial state empty array). If the user wants, it is possible to import the atoms in the UCUM code system executing a rake task.

In the database, there are 2 extra columns as well, "code_function_from" and "code_function_to" for all those units that need a function to be converted (see Celsius to kelvin for example.)

Would anyone be interested to help me make it a little less patchy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant