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

  • Home
  • SEARCH
  • 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 8901337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:19:35+00:00 2026-06-15T01:19:35+00:00

I am looking at some open source code to better familiarize myself with rails

  • 0

I am looking at some open source code to better familiarize myself with rails code.

I see the following in the application_controller

  def can_signup?
    [ :allowed, :needs_approval ].include? Setting.user_signup
  end

I can’t seem to find where this method is defined in the code Setting.user_signup

Setting is a model

What can I be missing? link to code: https://github.com/fatfreecrm/fat_free_crm/blob/master/app/controllers/application_controller.rb#L155-157

Grep output:

/rails_projects/fat_free_crm $ grep -r --include="*.rb" "user_signup" .
./app/controllers/application_controller.rb:    [ :allowed, :needs_approval ].include? Setting.user_signup
./app/controllers/users_controller.rb:      if Setting.user_signup == :needs_approval
./app/models/users/user.rb:    self.suspended? && self.login_count == 0 && Setting.user_signup == :needs_approval
./app/models/users/user.rb:    self.suspended_at = Time.now if Setting.user_signup == :needs_approval && !self.admin
./spec/controllers/authentications_controller_spec.rb:          Setting.stub!(:user_signup).and_return(:needs_approval)
./spec/controllers/users_controller_spec.rb:        Setting.stub!(:user_signup).and_return(:needs_approval)
./spec/models/users/user_spec.rb:    Setting.stub(:user_signup).and_return(:needs_approval)
./spec/models/users/user_spec.rb:    Setting.stub(:user_signup).and_return(:needs_approval)
  • 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-15T01:19:37+00:00Added an answer on June 15, 2026 at 1:19 am

    In this case the Setting model is using method_missing, which is a special method called (if defined) when a NoMethodError exception is raised.

    More info on method_missing here:
    http://rubylearning.com/satishtalim/ruby_method_missing.html

    If you take a look to method_missing implementation in Setting:
    https://github.com/fatfreecrm/fat_free_crm/blob/master/app/models/setting.rb#L54-65

    You’ll find that Setting.user_signup will become Setting['user_signup'], so the [] method will be called with user_signup as first argument:
    https://github.com/fatfreecrm/fat_free_crm/blob/master/app/models/setting.rb#L69-84

    That method ([]), according to documentation, will search a setting within a database table or a .yml file with the name equal to the first argument, and then returns the relative value.

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

Sidebar

Related Questions

I have been looking through some code on an open source project recently and
I'm looking at some open source projects and I'm seeing the following: NSLog(@%s w=%f,
Looking at some assembly code for x86_64 on my Mac, I see the following
While looking at some open source code to learn more about J2EE, I came
After looking at some open source projects C code I'm not sure if I'm
I'm writing some JVM instance related application and looking at open source to see
I'm looking at some open source code and trying to understand why the author
I'm looking over some open-source code and can't wrap my head around this snippet.
I was recently looking through some open source code PicketLink code. If you take
I am looking over some open source code and they listed some strange instance

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.