uses new hash syntax by default
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
class Comment < ActiveRecord::Base
|
class Comment < ActiveRecord::Base
|
||||||
acts_as_nested_set :scope => [:commentable_id, :commentable_type]
|
acts_as_nested_set scope: [:commentable_id, :commentable_type]
|
||||||
|
|
||||||
validates :body, :presence => true
|
validates :body, presence: true
|
||||||
validates :user, :presence => true
|
validates :user, presence: true
|
||||||
|
|
||||||
belongs_to :commentable, :polymorphic => true
|
belongs_to :commentable, polymorphic: true
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|
||||||
def self.build(commentable, user, body)
|
def self.build(commentable, user, body)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<% if user_signed_in? %>
|
<% if user_signed_in? %>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to('Logout', destroy_user_session_path, :method => :delete) %>
|
<%= link_to('Logout', destroy_user_session_path, method: :delete) %>
|
||||||
</li>
|
</li>
|
||||||
<% else %>
|
<% else %>
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
devise_for :users, :controllers => { registrations: 'registrations' }
|
devise_for :users, controllers: { registrations: 'registrations' }
|
||||||
|
|
||||||
# The priority is based upon order of creation: first created -> highest priority.
|
# The priority is based upon order of creation: first created -> highest priority.
|
||||||
# See how all your routes lay out with "rake routes".
|
# See how all your routes lay out with "rake routes".
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ class ActsAsVotableMigration < ActiveRecord::Migration
|
|||||||
def self.up
|
def self.up
|
||||||
create_table :votes do |t|
|
create_table :votes do |t|
|
||||||
|
|
||||||
t.references :votable, :polymorphic => true
|
t.references :votable, polymorphic: true
|
||||||
t.references :voter, :polymorphic => true
|
t.references :voter, polymorphic: true
|
||||||
|
|
||||||
t.boolean :vote_flag
|
t.boolean :vote_flag
|
||||||
t.string :vote_scope
|
t.string :vote_scope
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class ActsAsCommentableWithThreadingMigration < ActiveRecord::Migration
|
class ActsAsCommentableWithThreadingMigration < ActiveRecord::Migration
|
||||||
def self.up
|
def self.up
|
||||||
create_table :comments, :force => true do |t|
|
create_table :comments, force: true do |t|
|
||||||
t.integer :commentable_id
|
t.integer :commentable_id
|
||||||
t.string :commentable_type
|
t.string :commentable_type
|
||||||
t.string :title
|
t.string :title
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ feature 'Comments' do
|
|||||||
debate = create(:debate)
|
debate = create(:debate)
|
||||||
comment = create(:comment, commentable: debate, user: citizen)
|
comment = create(:comment, commentable: debate, user: citizen)
|
||||||
|
|
||||||
visit debate_path(debate)
|
|
||||||
login_as(manuela)
|
login_as(manuela)
|
||||||
|
visit debate_path(debate)
|
||||||
|
|
||||||
within "#comment-#{comment.id}" do
|
within "#comment-#{comment.id}" do
|
||||||
fill_in 'comment_body', with: 'La semana que viene está hecho.'
|
fill_in 'comment_body', with: 'La semana que viene está hecho.'
|
||||||
|
|||||||
Reference in New Issue
Block a user