Sha256: 632823c0bd27d80a9b5a694b639be2b209b98105f232d84bc3858f263d1328b7
Contents?: true
Size: 569 Bytes
Versions: 19
Compression:
Stored size: 569 Bytes
Contents
class EricWeixin::Article < ActiveRecord::Base self.table_name = "weixin_articles" validates_presence_of :title, :pic_url, :link_url has_many :weixin_article_newses, :class_name => '::EricWeixin::ArticleNews', foreign_key: "weixin_article_id" has_many :weixin_news_datas, :class_name => '::EricWeixin::NewsData', through: :weixin_article_newses class << self def create_article_data options ::EricWeixin::Article.transaction do article = ::EricWeixin::Article.new(options) article.save! article end end end end
Version data entries
19 entries across 19 versions & 1 rubygems