ruby on rails - ActiveRecord: class methods without scoping -


i need create class method of activerecord. method not meant scope, i'd prevent misusage of scope. possible do?

like kiddorails hinted, not possible. underlying reason ar puts many responsibilities 1 class -- validation, persistence, finding/querying. if care encapsulating these methods in 1 place, might consider creating separate class (which prevent 'misuse' nature has query-related methods) handles query-related logic. (there other strategies 1 consider well, too)


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -