Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/her/model/base.rb
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/her/model/orm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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+.
Expand Down
4 changes: 2 additions & 2 deletions lib/her/model/parse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/model/relation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down