From a31436ff324d77fa5b2acf1078ce549637b0b7db Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Mon, 22 Apr 2024 14:19:17 +0800 Subject: [PATCH] Fix typos Found via `codespell -H` and `typos --format brief` --- lib/her/model/base.rb | 4 ++-- lib/her/model/orm.rb | 2 +- lib/her/model/parse.rb | 4 ++-- spec/model/relation_spec.rb | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/her/model/base.rb b/lib/her/model/base.rb index fe08f839..d44c3f7c 100644 --- a/lib/her/model/base.rb +++ b/lib/her/model/base.rb @@ -1,6 +1,6 @@ module Her module Model - # This module includes basic functionnality to Her::Model + # This module includes basic functionality to Her::Model module Base extend ActiveSupport::Concern @@ -16,7 +16,7 @@ def has_key?(attribute_name) # Returns # * the value of the attribute_name attribute if it's in orm data - # * the resource/collection corrsponding to attribute_name if it's an association + # * the resource/collection corresponding to attribute_name if it's an association # # @private def [](attribute_name) diff --git a/lib/her/model/orm.rb b/lib/her/model/orm.rb index e15fc666..0b251f75 100644 --- a/lib/her/model/orm.rb +++ b/lib/her/model/orm.rb @@ -105,7 +105,7 @@ def increment!(attribute, by = 1) self end - # Initializes +attribute+ to zero if +nil+ and substracts the value passed as + # Initializes +attribute+ to zero if +nil+ and subtracts the value passed as # +by+ (default is 1). The decrement is performed directly on the # underlying attribute, no setter is invoked. Only makes sense for # number-based attributes. Returns +self+. diff --git a/lib/her/model/parse.rb b/lib/her/model/parse.rb index 51b4a31a..e59a99c1 100644 --- a/lib/her/model/parse.rb +++ b/lib/her/model/parse.rb @@ -42,7 +42,7 @@ def to_params(attributes, changes = {}) memo[key.to_sym] = value end - filtered_attributes.merge!(embeded_params(attributes)) + filtered_attributes.merge!(embedded_params(attributes)) if her_api.options[:send_only_modified_attributes] filtered_attributes.slice! *changes.keys.map(&:to_sym) @@ -60,7 +60,7 @@ def to_params(attributes, changes = {}) end # @private - def embeded_params(attributes) + def embedded_params(attributes) associations.values.flatten.each_with_object({}) do |definition, hash| value = case association = attributes[definition[:name]] when Her::Collection, Array diff --git a/spec/model/relation_spec.rb b/spec/model/relation_spec.rb index b8bd658c..1b430ea6 100644 --- a/spec/model/relation_spec.rb +++ b/spec/model/relation_spec.rb @@ -31,7 +31,7 @@ spawn_model "Foo::User" end - it "doesn't fetch the data immediatly" do + it "doesn't fetch the data immediately" do expect(Foo::User).to receive(:request).never @users = Foo::User.where(admin: 1) end