Skip to content

Commit

Permalink
Fix several typos and spelling errors (#3529)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdufresne authored Jun 13, 2022
1 parent d1e3334 commit ce1bb5a
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/rails_admin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module RailsAdmin
#
# If only a block is passed it is stored to initializer stack to be evaluated
# on first request in production mode and on each request in development. If
# initialization has already occured (in other words RailsAdmin.setup has
# initialization has already occurred (in other words RailsAdmin.setup has
# been called) the block will be added to stack and evaluated at once.
#
# Otherwise returns RailsAdmin::Config class.
Expand Down
2 changes: 1 addition & 1 deletion lib/rails_admin/adapters/mongoid/association.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def nested_options
nested = nested_attributes_options.try { |o| o[name] }
if !nested && %i[embeds_one embeds_many].include?(macro.to_sym) && !cyclic?
raise <<~MSG
Embbeded association without accepts_nested_attributes_for can't be handled by RailsAdmin,
Embedded association without accepts_nested_attributes_for can't be handled by RailsAdmin,
because embedded model doesn't have top-level access.
Please add `accepts_nested_attributes_for :#{association.name}' line to `#{model}' model.
MSG
Expand Down
2 changes: 1 addition & 1 deletion lib/rails_admin/config/fields.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module Fields

# Registry of field factories.
#
# Field factory is an anonymous function that recieves the parent object,
# Field factory is an anonymous function that receives the parent object,
# an array of field properties and an array of fields already instantiated.
#
# If the factory returns true then that property will not be run through
Expand Down
2 changes: 1 addition & 1 deletion lib/rails_admin/config/fields/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def parse_value(value)
end

def parse_input(_params)
# overriden
# overridden
end

def inverse_of
Expand Down
2 changes: 1 addition & 1 deletion lib/rails_admin/config/has_fields.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def configure(name, type = nil, &block)
[*name].each { |field_name| field(field_name, type, false, &block) }
end

# include fields by name and apply an optionnal block to each (through a call to fields),
# include fields by name and apply an optional block to each (through a call to fields),
# or include fields by conditions if no field names
def include_fields(*field_names, &block)
if field_names.empty?
Expand Down
4 changes: 2 additions & 2 deletions spec/integration/actions/edit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -428,13 +428,13 @@ class HelpTest < Tableless
field :name do
read_only true
formatted_value do
"I'm outputed in the form"
"I'm outputted in the form"
end
end
end
end
visit new_path(model_name: 'team')
is_expected.to have_content("I'm outputed in the form")
is_expected.to have_content("I'm outputted in the form")
end

it 'is hideable' do
Expand Down
4 changes: 2 additions & 2 deletions spec/rails_admin/adapters/mongoid/association_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ class MongoRecursivelyEmbedsMany
recursively_embeds_many
end

expect { RailsAdmin::AbstractModel.new(MongoEmbedsOne).associations.first.nested_options }.to raise_error(RuntimeError, "Embbeded association without accepts_nested_attributes_for can't be handled by RailsAdmin,\nbecause embedded model doesn't have top-level access.\nPlease add `accepts_nested_attributes_for :mongo_embedded' line to `MongoEmbedsOne' model.\n")
expect { RailsAdmin::AbstractModel.new(MongoEmbedsMany).associations.first.nested_options }.to raise_error(RuntimeError, "Embbeded association without accepts_nested_attributes_for can't be handled by RailsAdmin,\nbecause embedded model doesn't have top-level access.\nPlease add `accepts_nested_attributes_for :mongo_embeddeds' line to `MongoEmbedsMany' model.\n")
expect { RailsAdmin::AbstractModel.new(MongoEmbedsOne).associations.first.nested_options }.to raise_error(RuntimeError, "Embedded association without accepts_nested_attributes_for can't be handled by RailsAdmin,\nbecause embedded model doesn't have top-level access.\nPlease add `accepts_nested_attributes_for :mongo_embedded' line to `MongoEmbedsOne' model.\n")
expect { RailsAdmin::AbstractModel.new(MongoEmbedsMany).associations.first.nested_options }.to raise_error(RuntimeError, "Embedded association without accepts_nested_attributes_for can't be handled by RailsAdmin,\nbecause embedded model doesn't have top-level access.\nPlease add `accepts_nested_attributes_for :mongo_embeddeds' line to `MongoEmbedsMany' model.\n")
expect { RailsAdmin::AbstractModel.new(MongoRecursivelyEmbedsOne).associations.first.nested_options }.not_to raise_error
expect { RailsAdmin::AbstractModel.new(MongoRecursivelyEmbedsMany).associations.first.nested_options }.not_to raise_error
end
Expand Down
4 changes: 2 additions & 2 deletions spec/rails_admin/config/fields/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
class ConditionalValidationTest < Tableless
column :foo, :varchar
column :bar, :varchar
validates :foo, presence: true, if: :presisted?
validates :bar, presence: true, unless: :presisted?
validates :foo, presence: true, if: :persisted?
validates :bar, presence: true, unless: :persisted?
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/rails_admin/config/has_fields_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
end
end

it "does not cause FrozenError by changing exiting field's tye" do
it "does not cause FrozenError by changing exiting field's type" do
# Reference the fields for readonly
config.edit.send(:_fields, true)

Expand Down
4 changes: 2 additions & 2 deletions spec/rails_admin/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@

it 'can be configured' do
RailsAdmin.config do |config|
config.main_app_name = %w[stati c value]
config.main_app_name = %w[static value]
end
expect(RailsAdmin.config.main_app_name).to eq(%w[stati c value])
expect(RailsAdmin.config.main_app_name).to eq(%w[static value])
end
end

Expand Down

0 comments on commit ce1bb5a

Please sign in to comment.