Skip to content

Commit

Permalink
Cleanup: Use schema_monkey rather than explicitly patching ActiveRecord.
Browse files Browse the repository at this point in the history
This eliminates the various alias_method_chains, and the railtie.

Addresses #16
  • Loading branch information
ronen committed Mar 6, 2016
1 parent 10d7b06 commit 9bd76bf
Show file tree
Hide file tree
Showing 4 changed files with 203 additions and 226 deletions.
9 changes: 1 addition & 8 deletions lib/schema_associations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

require 'schema_associations/version'
require 'schema_associations/active_record/associations'
require 'schema_associations/railtie' if defined?(Rails)

module SchemaAssociations

Expand Down Expand Up @@ -108,12 +107,6 @@ def self.setup # :yields: config
yield config
end

def self.insert #:nodoc:
return if @inserted
@inserted = true
::ActiveRecord::Base.extend SchemaAssociations::ActiveRecord::Associations
end

end

SchemaAssociations.insert unless defined? Rails::Railtie
SchemaMonkey.register SchemaAssociations
Loading

0 comments on commit 9bd76bf

Please sign in to comment.