Created
February 4, 2010 17:34
-
-
Save tal/294904 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InfoCount < Sequel::Model | |
unrestrict_primary_key | |
class << self | |
def [](*args) | |
ret = super(*args) | |
if args.size == 1 && !ret && args.first | |
ret = create(:user_id => args.first) | |
end | |
ret | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment