app/models/georgia/concerns/contentable.rb in georgia-0.7.8 vs app/models/georgia/concerns/contentable.rb in georgia-0.8.0
- old
+ new
@@ -6,19 +6,18 @@
extend ActiveSupport::Concern
included do
has_many :contents, as: :contentable, dependent: :destroy, class_name: Georgia::Content
accepts_nested_attributes_for :contents
- attr_accessible :contents_attributes
- scope :with_locale, lambda {|locale| joins(:contents).where(georgia_contents: {locale: locale}).uniq}
+ scope :with_locale, -> (locale) { joins(:contents).where(georgia_contents: {locale: locale}).uniq }
def content(locale=nil)
locale ||= I18n.locale.to_s
@content ||= contents.select{|c| c.locale == locale}.first || Georgia::Content.new(locale: locale)
end
- delegate :title, :text, :excerpt, :keywords, :keyword_list, :image, :locale, to: :content
+ delegate :title, :text, :excerpt, :keywords, :keyword_list, :image, :locale, to: :content
end
end
end
end
\ No newline at end of file