Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9274313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:19:30+00:00 2026-06-18T16:19:30+00:00

In my app, we have Users who can perform actions on one another –

  • 0

In my app, we have Users who can perform actions on one another – like poking on Facebook.

I’m writing the methods just now and am not really sure which approach to take.
I mean, I know they’re both acceptable but is there a more idiomatic approach?

Option 1

if @current_user.may_poke?(@other_user)
  @current_user.poke!(@other_user)
end

Option 2

if @current_user.may_poke?(@other_user)
  @other_user.poke!(@current_user)
end

The first option reads better in English, almost perfectly as a sentence.
The second option makes more sense in terms of method naming, “poke” is a method being performed on the @other_user. The @current_user is just an argument to provide extra info – who did the poking.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:19:32+00:00Added an answer on June 18, 2026 at 4:19 pm

    I’d stick with Option 1 there.. if you follow the logic of the conditional, then you’re asking “If current_user may poke other_user, then have current_user poke other_user”. Option 2 doesn’t make much sense when thought of in those terms.

    Also.. matz, the author of Ruby, states that “The bang [exclamation point] sign means “the bang version is more dangerous than its non bang counterpart; handle with care”.” ( http://www.ruby-forum.com/topic/176830#773946 ). I’d probably just use poke for that method name instead of poke!.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app where users can sign up with Facebook, in which case
In a Rails app I have Users who can have notes created under them
I have an app where users can change a toggle value between true and
I have an app in which users can follow law firms I have 3
INFORMIX-SQL 7.32 (SE) Linux Pawnshop App. I have some users who own several pawnshops
I have an app which allows users to log in via Facebook, and all
Is there a way I can indicate to users who have downloaded a blackberry
i have users who can logon to my site. I don't use the asp.net
I have users who have authorised my app and are using it. I now
I'm trying to create an iOS (iPhone specific) app where users have to authenticate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.