Skip to content

Commit

Permalink
Adjust the field path to fit Ruby conventions
Browse files Browse the repository at this point in the history
Problem:

File paths within the `lib` folder have inconsistent pluralization.
According to ruby convention, each class should be stored in a file
where the parent directories correspond to the namespaces of the class.

For us, our `Administrate::Field` classes
are stored in `administrate/fields`.
The incorrect pluralization breaks Ruby's convention.

Solution:

Move `lib/administrate/fields` -> `lib/administrate/field`.
  • Loading branch information
c-lliope committed Feb 20, 2016
1 parent 765d3ff commit 12699c9
Show file tree
Hide file tree
Showing 31 changed files with 30 additions and 30 deletions.
22 changes: 11 additions & 11 deletions lib/administrate/base_dashboard.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
require "administrate/fields/belongs_to"
require "administrate/fields/boolean"
require "administrate/fields/date_time"
require "administrate/fields/email"
require "administrate/fields/has_many"
require "administrate/fields/has_one"
require "administrate/fields/image"
require "administrate/fields/number"
require "administrate/fields/polymorphic"
require "administrate/fields/string"
require "administrate/fields/text"
require "administrate/field/belongs_to"
require "administrate/field/boolean"
require "administrate/field/date_time"
require "administrate/field/email"
require "administrate/field/has_many"
require "administrate/field/has_one"
require "administrate/field/image"
require "administrate/field/number"
require "administrate/field/polymorphic"
require "administrate/field/string"
require "administrate/field/text"

module Administrate
class BaseDashboard
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "administrate/fields/base"
require "administrate/field/base"

class <%= class_name %>Field < Administrate::Field::Base
def to_s
Expand Down
2 changes: 1 addition & 1 deletion spec/administrate/views/fields/has_one/_form_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "rails_helper"
require "administrate/fields/has_one"
require "administrate/field/has_one"

describe "fields/has_one/_form", type: :view do
it "displays the field name" do
Expand Down
2 changes: 1 addition & 1 deletion spec/administrate/views/fields/has_one/_show_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "rails_helper"
require "administrate/fields/has_one"
require "administrate/field/has_one"

describe "fields/has_one/_show", type: :view do
context "without an associated record" do
Expand Down
2 changes: 1 addition & 1 deletion spec/administrate/views/fields/polymorphic/_show_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "rails_helper"
require "administrate/fields/polymorphic"
require "administrate/field/polymorphic"

describe "fields/polymorphic/_show", type: :view do
context "without an associated records" do
Expand Down
6 changes: 3 additions & 3 deletions spec/lib/administrate/search_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require "spec_helper"
require "support/constant_helpers"
require "administrate/fields/string"
require "administrate/fields/email"
require "administrate/fields/number"
require "administrate/field/string"
require "administrate/field/email"
require "administrate/field/number"
require "administrate/search"

class MockDashboard
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/fields/belongs_to_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "administrate/fields/belongs_to"
require "administrate/field/belongs_to"
require "support/constant_helpers"
require "support/field_matchers"

Expand Down
2 changes: 1 addition & 1 deletion spec/lib/fields/boolean_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "spec_helper"
require "administrate/fields/boolean"
require "administrate/field/boolean"
require "support/field_matchers"

describe Administrate::Field::Boolean do
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/fields/date_time_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "spec_helper"
require "administrate/fields/date_time"
require "administrate/field/date_time"
require "support/field_matchers"

describe Administrate::Field::DateTime do
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/fields/deferred_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "administrate/fields/deferred"
require "administrate/fields/string"
require "administrate/field/deferred"
require "administrate/field/string"

describe Administrate::Field::Deferred do
describe "#permitted_attribute" do
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/fields/email_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "administrate/fields/email"
require "administrate/field/email"

describe Administrate::Field::Email do
describe "#to_partial_path" do
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/fields/has_many_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "administrate/fields/has_many"
require "administrate/field/has_many"
require "support/constant_helpers"
require "support/mock_relation"

Expand Down
2 changes: 1 addition & 1 deletion spec/lib/fields/has_one_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "administrate/fields/has_one"
require "administrate/field/has_one"
require "support/constant_helpers"

describe Administrate::Field::HasOne do
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/fields/image_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "administrate/fields/image"
require "administrate/field/image"

describe Administrate::Field::Image do
describe "#to_partial_path" do
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/fields/number_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "administrate/fields/number"
require "administrate/field/number"
require "support/field_matchers"

describe Administrate::Field::Number do
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/fields/polymorphic_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "administrate/fields/polymorphic"
require "administrate/field/polymorphic"
require "support/constant_helpers"
require "support/field_matchers"

Expand Down
2 changes: 1 addition & 1 deletion spec/lib/fields/string_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "administrate/fields/string"
require "administrate/field/string"
require "support/field_matchers"

describe Administrate::Field::String do
Expand Down

0 comments on commit 12699c9

Please sign in to comment.