Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Commit

Permalink
Update hash syntax to Ruby 1.9 symbol notation
Browse files Browse the repository at this point in the history
  • Loading branch information
askl56 committed Apr 24, 2017
1 parent 0c1c182 commit c8cebbc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/models/follow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class Follow < ActiveRecord::Base
extend ActsAsFollower::FollowScopes

# NOTE: Follows belong to the "followable" interface, and also to followers
belongs_to :followable, :polymorphic => true
belongs_to :follower, :polymorphic => true
belongs_to :followable, polymorphic: true
belongs_to :follower, polymorphic: true

def block!
self.update_attribute(:blocked, true)
Expand Down
12 changes: 6 additions & 6 deletions db/migrate/20160712061614_acts_as_follower_migration.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
class ActsAsFollowerMigration < ActiveRecord::Migration
def self.up
create_table :follows, :force => true do |t|
t.references :followable, :polymorphic => true, :null => false
t.references :follower, :polymorphic => true, :null => false
t.boolean :blocked, :default => false, :null => false
create_table :follows, force: true do |t|
t.references :followable, polymorphic: true, null: false
t.references :follower, polymorphic: true, null: false
t.boolean :blocked, default: false, null: false
t.timestamps
end

add_index :follows, ["follower_id", "follower_type"], :name => "fk_follows"
add_index :follows, ["followable_id", "followable_type"], :name => "fk_followables"
add_index :follows, ["follower_id", "follower_type"], name: "fk_follows"
add_index :follows, ["followable_id", "followable_type"], name: "fk_followables"
end

def self.down
Expand Down

0 comments on commit c8cebbc

Please sign in to comment.