Table name: configurations
id :integer not null, primary key settings :text type :string(255) created_at :datetime updated_at :datetime university_id :integer
To set the class variable for client
# File app/models/configurations/pusher.rb, line 44 def self.clients @@clients ||= {} end
To set the client.
# File app/models/configurations/pusher.rb, line 30 def client if enabled? return self.class.clients[self.id] if self.class.clients[self.id] self.class.clients[self.id] = Pusher::Client.new({ app_id: app_id, key: api_key, secret: api_secret }) else nil end end
To update pusher client for chat converstion.
# File app/models/configurations/pusher.rb, line 24 def update_pusher_client! self.class.clients.delete(self.id) self.client end