Skip to content

Commit

Permalink
Fixes additional
Browse files Browse the repository at this point in the history
  • Loading branch information
Arugin committed Sep 30, 2013
1 parent d84a65e commit 2683cf4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/controllers/contents_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def destroy
return
end
rescue Exception => e
redirect_to ession.delete(:destroy_gallery), alert: message + e.message
redirect_to session.delete(:destroy_gallery), alert: message + e.message
return
end
redirect_to session[:destroy_gallery], notice: t(:CONTENT_REMOVE_SUCCESS)
Expand Down
2 changes: 1 addition & 1 deletion app/models/content/base_content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class BaseContent

belongs_to :contentable, polymorphic: true

has_many :comments, dependent: :restrict, as: :commentable, class_name: 'Comment'
has_many :comments, dependent: :destroy, as: :commentable, class_name: 'Comment'

scope :random, all.where(approved_to_news: true, reviewed: true)
scope :non_approved, lambda { |user, params = {}|
Expand Down
4 changes: 2 additions & 2 deletions app/models/gallery.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ class Gallery
validates :name, presence: true, length: {minimum:3,maximum: 70}
validates :description, length: {maximum: 1000}

has_many :contents, as: :contentable, class_name: 'Content::BaseContent'
has_many :contents, dependent: :destroy, as: :contentable, class_name: 'Content::BaseContent'
accepts_nested_attributes_for :contents, :reject_if => lambda { |b| b[:src].blank? }

has_many :comments, dependent: :restrict, as: :commentable, class_name: 'Comment'
has_many :comments, dependent: :destroy, as: :commentable, class_name: 'Comment'

def title
name
Expand Down
2 changes: 1 addition & 1 deletion app/views/galleries/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%h3 Создание галлереи работ
%h3 Создание галереи работ
= horizontal_simple_form_for(@gallery, :validate => true) do |f|
= f.error_notification

Expand Down
2 changes: 1 addition & 1 deletion app/views/office/galleries.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.row
.span3
%h4.section-small Мои галлереи
%h4.section-small Мои галереи
.span5
.pull-right
= link_to new_gallery_path, :class=>'btn btn-primary' do
Expand Down
14 changes: 7 additions & 7 deletions config/locales/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ru:
NO_NEWS: Нет новостей
NO_OFFICE_ARTICLES: Не написано ещё ни одной статьи
NO_OFFICE_CYCLES: Не создано ещё ни одного цикла
NO_OFFICE_GALLERIES: Не создано ещё ни одной галлереи
NO_OFFICE_GALLERIES: Не создано ещё ни одной галереи
NO_NON_APPROVED_CONTENTS: Нет неподтвержденных работ
CONTENT_APPROVE_SUCCESS: Работа подтверждена
NO_COMMENTS_HERE: Нет ни одного комментария
Expand Down Expand Up @@ -46,12 +46,12 @@ ru:
ARTICLE_REMOVE_SUCCESS: Статья успешно удалена

# galleries
GALLERY_CREATE_SUCCESS: Галлерея успешно создана
GALLERY_UPDATE_SUCCESS: Галлерея успешно обновлена
UNABLE_TO_DELETE_GALLERY: Невозможно удалить галлеррею
GALLERY_CREATE_SUCCESS: Галерея успешно создана
GALLERY_UPDATE_SUCCESS: Галерея успешно обновлена
UNABLE_TO_DELETE_GALLERY: Невозможно удалить галеррею
GALLERY_REMOVE_SUCCESS: Галерея успешно удалена
NEW_GALLERY: Новая галлерея
NO_GALLERY_CONTENT: В галлерее ещё нет работ
NEW_GALLERY: Новая галерея
NO_GALLERY_CONTENT: В галерее ещё нет работ

# content
CONTENT_ADD_SUCCESSFULLY: Работа добавлена успешно
Expand Down Expand Up @@ -204,7 +204,7 @@ ru:
article: статью
cycle: цикл
user: профиль
gallery: галлерею
gallery: галерею
errors:
models:
user:
Expand Down

0 comments on commit 2683cf4

Please sign in to comment.