mirror of
https://github.com/discourse/discourse.git
synced 2024-12-20 15:53:42 +08:00
9e9abe0a82
Currently, there are two ways (kind of) for accessing `params` inside a service: - when there is no contract or it hasn’t been reached yet, `params` is just the hash that was provided to the service. To access a key, you have to use the bracket notation `params[:my_key]`. - when there is a contract and it has been executed successfully, `params` now references the contract and the attributes are accessible using methods (`params.my_key`). This patch unifies how `params` exposes its attributes. Now, even if there is no contract at all in a service, `params` will expose its attributes through methods, that way things are more consistent. This patch also makes sure there is always a `params` object available even when no `params` key is provided to the service (this allows a contract to fail because its attributes are blank instead of having the service raising an error because it doesn’t find `params` in its context). |
||
---|---|---|
.. | ||
action | ||
channel/policy | ||
direct_message_channel/policy | ||
add_users_to_channel.rb | ||
auto_join_channels.rb | ||
auto_leave_channels.rb | ||
create_category_channel.rb | ||
create_direct_message_channel.rb | ||
create_message_interaction.rb | ||
create_message.rb | ||
create_thread.rb | ||
flag_message.rb | ||
invite_users_to_channel.rb | ||
leave_channel.rb | ||
list_channel_messages.rb | ||
list_channel_thread_messages.rb | ||
list_user_channels.rb | ||
lookup_channel_threads.rb | ||
lookup_thread.rb | ||
lookup_user_threads.rb | ||
mark_all_user_channels_read.rb | ||
mark_thread_title_prompt_seen.rb | ||
message_destroyer.rb | ||
publisher.rb | ||
restore_message.rb | ||
search_chatable.rb | ||
start_reply.rb | ||
stop_message_streaming.rb | ||
stop_reply.rb | ||
tracking_state.rb | ||
trash_channel.rb | ||
trash_message.rb | ||
trash_messages.rb | ||
unfollow_channel.rb | ||
update_channel_status.rb | ||
update_channel.rb | ||
update_message.rb | ||
update_thread_notification_settings.rb | ||
update_thread.rb | ||
update_user_channel_last_read.rb | ||
update_user_thread_last_read.rb | ||
upsert_draft.rb |