diff --git a/lib/rails_admin.rb b/lib/rails_admin.rb index 7f70d4d507..5a43a0d7b1 100644 --- a/lib/rails_admin.rb +++ b/lib/rails_admin.rb @@ -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. diff --git a/lib/rails_admin/adapters/mongoid/association.rb b/lib/rails_admin/adapters/mongoid/association.rb index 80bcc43203..726fbd6a24 100644 --- a/lib/rails_admin/adapters/mongoid/association.rb +++ b/lib/rails_admin/adapters/mongoid/association.rb @@ -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 diff --git a/lib/rails_admin/config/fields.rb b/lib/rails_admin/config/fields.rb index 9a815175fd..907e5e2e16 100644 --- a/lib/rails_admin/config/fields.rb +++ b/lib/rails_admin/config/fields.rb @@ -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 diff --git a/lib/rails_admin/config/fields/base.rb b/lib/rails_admin/config/fields/base.rb index 5017960139..d3ac3aa8ae 100644 --- a/lib/rails_admin/config/fields/base.rb +++ b/lib/rails_admin/config/fields/base.rb @@ -353,7 +353,7 @@ def parse_value(value) end def parse_input(_params) - # overriden + # overridden end def inverse_of diff --git a/lib/rails_admin/config/has_fields.rb b/lib/rails_admin/config/has_fields.rb index 6418cde2c4..864b9a428b 100644 --- a/lib/rails_admin/config/has_fields.rb +++ b/lib/rails_admin/config/has_fields.rb @@ -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? diff --git a/spec/integration/actions/edit_spec.rb b/spec/integration/actions/edit_spec.rb index 83e3de069c..dec5003c7c 100644 --- a/spec/integration/actions/edit_spec.rb +++ b/spec/integration/actions/edit_spec.rb @@ -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 diff --git a/spec/rails_admin/adapters/mongoid/association_spec.rb b/spec/rails_admin/adapters/mongoid/association_spec.rb index 9bee03e11f..0bde4f1b30 100644 --- a/spec/rails_admin/adapters/mongoid/association_spec.rb +++ b/spec/rails_admin/adapters/mongoid/association_spec.rb @@ -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 diff --git a/spec/rails_admin/config/fields/base_spec.rb b/spec/rails_admin/config/fields/base_spec.rb index eb6714defd..f9c5ef8b1a 100644 --- a/spec/rails_admin/config/fields/base_spec.rb +++ b/spec/rails_admin/config/fields/base_spec.rb @@ -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 diff --git a/spec/rails_admin/config/has_fields_spec.rb b/spec/rails_admin/config/has_fields_spec.rb index 521f556352..8c7d3ca729 100644 --- a/spec/rails_admin/config/has_fields_spec.rb +++ b/spec/rails_admin/config/has_fields_spec.rb @@ -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) diff --git a/spec/rails_admin/config_spec.rb b/spec/rails_admin/config_spec.rb index 521515960c..70a060cc8f 100644 --- a/spec/rails_admin/config_spec.rb +++ b/spec/rails_admin/config_spec.rb @@ -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