Giter VIP home page Giter VIP logo

Comments (5)

dblock avatar dblock commented on August 17, 2024

I think you need an establish_connection call and explicit loading of the config. Take a look at https://github.com/slack-ruby/slack-ruby-bot-server/blob/v0.12.2/sample_apps/sample_app_activerecord/config.ru#L9 for example.

require 'yaml'

ActiveRecord::Base.establish_connection(
  YAML.safe_load(
    ERB.new(
      File.read('config/postgresql.yml')
    ).result, [], [], true
  )[ENV['RACK_ENV']]
)

We used to have a sample app here and I think people could find that code, but I moved the samples out. If this works:

  1. Let's add the above to the README.
  2. Let's modify https://github.com/slack-ruby/slack-ruby-bot-server-events-sample to also work with ActiveRecord (or make a copy of it that does).

Would appreciate any help with the above.

from slack-ruby-bot-server.

primary0 avatar primary0 commented on August 17, 2024

That worked thanks! I will send a PR for the README addition.

from slack-ruby-bot-server.

dblock avatar dblock commented on August 17, 2024

Let's reopen till we have it in the README.

from slack-ruby-bot-server.

dblock avatar dblock commented on August 17, 2024

@primary0 Bump?

from slack-ruby-bot-server.

dblock avatar dblock commented on August 17, 2024

99e91ed

from slack-ruby-bot-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.