Ruby / Rails - access to lookup table without modeling?

This is for the Ruby on Rails 3.0.x project.

I have a lookup table with data from a provider.

When I import data from another source, I want to check this table (attaching to the SKU) for additional data.

It doesn't seem to me right to create a model for this table in my application. My application will never be modified, and it should not have any model associations outside of the data search that I just mentioned. He just accidentally gained access to some information.

What is the best practice for accessing this table?

Thank.

+5
source share
3 answers

, , SQL- , .

: Rails SQL

, , , . , , (.. , , / , ). ActiveRecord , , , ..

+9

- YML, YML environment.rb.

:

 LOOK_UP_TABLE = YAML.load_file("#{RAILS_ROOT}/misc/vendor_data.yml")
+2

... ? , .

resource , . , , : - - , .

(Yaml, XML, ), .. , .

+1

All Articles