Skip to content

Commit

Permalink
attributes -> attribute_names
Browse files Browse the repository at this point in the history
  • Loading branch information
shioyama committed Jul 25, 2017
1 parent 10a98c9 commit 391112b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/mobility/active_model/backend_resetter.rb
Expand Up @@ -9,7 +9,7 @@ module ActiveModel
class BackendResetter < Mobility::BackendResetter

# (see Mobility::BackendResetter#initialize)
def initialize(attributes)
def initialize(attribute_names)
super

model_reset_method = @model_reset_method
Expand Down
10 changes: 5 additions & 5 deletions lib/mobility/backend_resetter.rb
Expand Up @@ -13,15 +13,15 @@ module Mobility
=end
class BackendResetter < Module
# @param [Array<String>] attributes Attributes whose backends should be reset
# @param [Array<String>] attribute_names Names of attributes whose backends should be reset
# @yield Backend to reset as context for block
# @raise [ArgumentError] if no block is provided.
def initialize(attributes, &block)
def initialize(attribute_names, &block)
raise ArgumentError, "block required" unless block_given?
@model_reset_method = Proc.new do
attributes.each do |attribute|
if @mobility_backends && @mobility_backends[attribute]
@mobility_backends[attribute].instance_eval(&block)
attribute_names.each do |name|
if @mobility_backends && @mobility_backends[name]
@mobility_backends[name].instance_eval(&block)
end
end
end
Expand Down

0 comments on commit 391112b

Please sign in to comment.