aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/favorite.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/favorite.rb')
-rw-r--r--app/models/favorite.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/favorite.rb b/app/models/favorite.rb
index f1fc836..df894fc 100644
--- a/app/models/favorite.rb
+++ b/app/models/favorite.rb
@@ -17,8 +17,8 @@ class Favorite < ActiveRecord::Base
def self.from_hash(hash)
begin
- f = create!(:tweet_id => hash[:tweet_id],
- :user_id => hash[:user_id])
+ f = create!(tweet_id: hash[:tweet_id],
+ user_id: hash[:user_id])
logger.debug("Created Favorite: #{hash[:user_id]} => #{hash[:tweet_id]}")
return f
@@ -32,14 +32,14 @@ class Favorite < ActiveRecord::Base
def self.from_tweet_object(tweet_object)
if tweet_object.favoriters.is_a? Array
tweet_object.favoriters.reverse.map do |uid|
- from_hash(:user_id => uid, :tweet_id => tweet_object.id)
+ from_hash(user_id: uid, tweet_id: tweet_object.id)
end
end
end
def self.delete_from_hash(hash)
- where(:tweet_id => hash[:tweet_id])
- .where(:user_id => hash[:user_id])
+ where(tweet_id: hash[:tweet_id])
+ .where(user_id: hash[:user_id])
.destroy_all
end
end