lib/fb_graph/application.rb in fb_graph-2.4.11 vs lib/fb_graph/application.rb in fb_graph-2.4.12

- old
+ new

@@ -24,19 +24,56 @@ @@attributes = [ :name, :namespace, :description, + :canvas_name, :category, - :company, - :icon_url, :subcategory, :link, + :company, + :icon_url, :logo_url, :daily_active_users, :weekly_active_users, :monthly_active_users, + :migrations, + :namespace, + :restrictions, + :app_domains, + :auth_dialog_data_help_url, + :auth_dialog_description, + :auth_dialog_headline, + :auth_dialog_perms_explanation, + :auth_referral_user_perms, + :auth_referral_friend_perms, + :auth_referral_default_activity_privacy, + :auth_referral_enabled, + :auth_referral_extended_perms, + :auth_referral_response_type, + :canvas_fluid_height, + :canvas_fluid_width, + :canvas_url, + :contact_email, + :created_time, + :creator_uid, + :deauth_callback_url, + :iphone_app_store_id, + :hosting_url, + :mobile_web_url, + :page_tab_default_name, + :page_tab_url, + :privacy_policy_url, + :secure_canvas_url, + :secure_page_tab_url, + :server_ip_whitelist, + :social_discovery, + :terms_of_service_url, + :user_support_email, + :user_support_url, + :website_url, + :type, :secret ] attr_accessor *@@attributes def initialize(client_id, attributes = {}) @@ -44,10 +81,19 @@ @@attributes.each do |key| # NOTE: # For some reason, Graph API returns daily_active_users, weekly_active_users, monthly_active_users as JSON string. value = if [:daily_active_users, :weekly_active_users, :monthly_active_users].include?(key) attributes[key].to_i + # Boolean fields may be returned as 1 for true or 0 for false + elsif [:auth_referral_enabled, :canvas_fluid_height, :canvas_fluid_width, :social_discovery] + if attributes[key] == 1 + true + elsif attributes[key] == 0 + false + else + attributes[key] + end else attributes[key] end self.send("#{key}=", value) end @@ -64,6 +110,6 @@ self.secret && get_access_token end alias_method_chain :access_token, :auto_fetch end -end \ No newline at end of file +end