lib/federails.rb in federails-0.2.0 vs lib/federails.rb in federails-0.3.0

- old
+ new

@@ -21,17 +21,24 @@ :app_version, :force_ssl, :site_host, :site_port, :enable_discovery, + :open_registrations, :app_layout, - :user_class, # @deprecated :server_routes_path, :client_routes_path, :remote_follow_url_method, - :user_profile_url_method, # @deprecated - :user_name_field, # @deprecated - :user_username_field, # @deprecated + :base_client_controller, ].each { |key| Configuration.send :"#{key}=", config[key] if config.key?(key) } + end + + # @return [Boolean] True if the given model is a possible entity + # + # @example + # puts "Follow #{some_actor.name}" if actor_entity? current_user + def self.actor_entity?(class_or_instance) + klass = class_or_instance.is_a?(Class) ? class_or_instance.name : class_or_instance.class.name + Configuration.entity_types.key? klass end end # rubocop:enable Style/ClassVars