require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env)
module App
class Application < Rails::Application
end
end
# -*- encoding : utf-8 -*-
App::Application.configure do
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = false
config.assets.js_compressor = :uglifier
config.assets.compile = false
config.assets.digest = true
config.assets.version = '1.0'
config.log_level = :info
config.i18n.fallbacks = true
config.i18n.available_locales = :ru
config.active_support.deprecation = :notify
config.action_mailer.default_url_options = { :host => 'site.ru' }
config.log_formatter = ::Logger::Formatter.new
config.action_mailer.smtp_settings = {
address: 'smtp.yandex.ru',
port: 465,
domain: 'site.ru',
user_name: 'login',
password: 'password',
authentication: 'plain',
enable_starttls_auto: true
}
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
end
config.action_mailer.smtp_settings = {
address: 'smtp.yandex.ru',
port: 465,
domain: 'домен.зона',
user_name: 'логин',
password: 'пароль',
authentication: 'plain',
enable_starttls_auto: true
}
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
http://pastebin.com/kviTjdEr
has_many :comments
has_many :posts, :through => :comments
has_many :comments
has_many :users, :through => :comments
belongs_to :post
belongs_to :user
@comment = @post.comments.create(comment_params)