Skip to content

Commit

Permalink
Split ClassMethods from Setup
Browse files Browse the repository at this point in the history
  • Loading branch information
shioyama committed Aug 5, 2017
1 parent b39aeca commit 963f869
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/mobility/backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def initialize(model, attribute, **_)
# Extend included class with +setup+ method
def self.included(base)
base.extend(Setup)
base.extend(ClassMethods)
end

# @param [String] attribute
Expand Down Expand Up @@ -115,7 +116,9 @@ def setup_model(model_class, attribute_names, **options)
return unless setup_block = @setup_block
model_class.class_exec(attribute_names, options, &setup_block)
end
end

module ClassMethods
# {Attributes} uses this method to get a backend class specific to the
# model using the backend. Backend classes can override this method to
# return a class specific to the model class using the backend (e.g.
Expand Down

0 comments on commit 963f869

Please sign in to comment.