0

I've found this post:

Array#add_condition But i didn't understand to how implement it in my rails project

How can i do it?

thanks

1
  • I don't think it's a great design. You're adding very specific functionality for building a WHERE clause to the general purpose Array class. It might be better to do this in the model base class, or perhaps by adding something to ActiveRecord::Base. Commented May 20, 2010 at 21:42

2 Answers 2

1

Just create add_condition.rb file, paste code snippet from your link and save it in lib directory in your Rails app.

Sign up to request clarification or add additional context in comments.

Comments

0

Copy and paste that code into a file. There — the method is added to Array. The lib directory would be a good place for it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.