Created
August 28, 2012 16:20
-
-
Save dallarosa/3499849 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 News < ActiveRecord::Base | |
include Translation::Google | |
attr_accessible :date, :description, :link, :title, :language | |
has_many :translations | |
def after_save | |
Translation.create({news_id: self.id, description:translate(self.description, self.language, "ja"), title: translate(self.title, self.language, "ja"), language: "ja" }) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment