Skip to content

Commit

Permalink
Don't expose internal superclass of Model
Browse files Browse the repository at this point in the history
  • Loading branch information
amarshall committed Dec 13, 2015
1 parent a5bb99e commit 7545ce4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/with_model/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,21 @@ class Model
def initialize name, options = {}
validate_options!(options)
@name = name.to_sym
@options = options
@model_block = nil
@table_block = nil
@table_options = {}
@superclass = options.fetch(:superclass, ActiveRecord::Base)
end

def create
table.create
@model = Class.new(superclass) do
@model = Class.new(@superclass) do
extend WithModel::Methods
end
stubber.stub_const @model
setup_model
end

def superclass
@options.fetch(:superclass, ActiveRecord::Base)
end

def destroy
stubber.unstub_const
remove_from_superclass_descendants
Expand Down

0 comments on commit 7545ce4

Please sign in to comment.