Skip to content

Can I use scenic without rails? #352

Answered by derekprior
jtrupiano asked this question in Q&A
Discussion options

You must be logged in to vote

You will also need to call Scenic.load somewhere in order to load our ActiveRecord monkey patches (the only way something like Scenic can work, unfortunately). This is done automatically in Rails by virtue of the Railties code. You can see what that method does here:

scenic/lib/scenic.rb

Lines 16 to 24 in be70905

# Hooks Scenic into Rails.
#
# Enables scenic migration methods, migration reversability, and `schema.rb`
# dumping.
def self.load
ActiveRecord::ConnectionAdapters::AbstractAdapter.include Scenic::Statements
ActiveRecord::Migration::CommandRecorder.include Scenic::CommandRecorder
ActiveRecord::SchemaDumper.prepend Scenic::SchemaDumper

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jtrupiano
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants