Skip to content

Instantly share code, notes, and snippets.

@MaksimAbramchuk
Last active June 20, 2016 08:38
Show Gist options
  • Save MaksimAbramchuk/9b1d14786e082858dba15db2578ea44b to your computer and use it in GitHub Desktop.
Save MaksimAbramchuk/9b1d14786e082858dba15db2578ea44b to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
validates_uniqueness_of :telegram_id
def set_next_bot_command(command)
self.bot_command_data[‘command’] = command
save
end
def get_next_bot_command
bot_command_data[‘command’]
end
def reset_next_bot_command
self.bot_command_data = {}
save
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment