app/controllers/concerns/adminpanel/facebook_actions.rb in adminpanel-2.6.1 vs app/controllers/concerns/adminpanel/facebook_actions.rb in adminpanel-3.0.0

- old
+ new

@@ -54,10 +54,11 @@ private def set_fb_auths_count @fb_auths_count ||= Auth.find_by_key('facebook') end + # Creates or updates the Facebook Auth token. def update_fb_auth(account_selected_name) auth = Auth.find_by(key: 'facebook', name: account_selected_name) if auth.nil? Auth.create( key: 'facebook', @@ -68,9 +69,11 @@ #only support 1 fb account auth.update_attribute(:value, params[model_name][:fb_page_access_key]) end end + # Extracts the name of the model + # @return Name of the model [String] def model_name @model.name.demodulize.downcase # ex: posts end end end