Created
May 3, 2010 05:41
-
-
Save oren/387801 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TranslationValue < ActiveRecord::Base | |
has_many :key_values | |
has_many :translation_keys, :through => :key_values | |
end | |
class TranslationKey < ActiveRecord::Base | |
has_many :key_values | |
has_many :translation_values, :through => :key_values | |
end | |
class KeyValue < ActiveRecord::Base | |
end | |
tv = TranslationValue.create(:text => 'test', :language_id => 1) | |
tk = TranslationKey.create(:name => 'key1') | |
how to add key model to value model and visa versa? | |
tv.translation_key_ids | |
NameError: uninitialized constant TranslationValue::KeyValue | |
TranslationValue has_many :translation_keys, :through => :key_values |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment