Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up sidebar plugins #812

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Clean up sidebar plugins #812

wants to merge 10 commits into from

Conversation

mvz
Copy link
Member

@mvz mvz commented Jul 29, 2017

No description provided.

end
end

def parse_request(_contents, _params)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put empty method definitions on a single line.

fields.reduce(sidebar: self) do |hash, field|
hash.merge(field.key => field.current_value(self))
end
def parse_request(contents, params)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use delegate to define delegations.

end

def short_name
self.class.short_name
def to_locals_hash

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use delegate to define delegations.

configuration.description
end

def fields

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use delegate to define delegations.

else
self.class.fieldmap
end
def display_name

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use delegate to define delegations.


def fields
self.class.fields
def content_partial

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use delegate to define delegations.

@@ -10,7 +10,7 @@ def index
def update
@sidebar = Sidebar.where(id: params[:id]).first
@old_s_index = @sidebar.staged_position || @sidebar.active_position
@sidebar.update_attributes params[:configure][@sidebar.id.to_s].permit!
@sidebar.update_attribute :config, params[:configure][@sidebar.id.to_s].permit!.to_hash

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using update_attribute because it skips validations.

@mvz mvz force-pushed the clean-up-sidebar-plugins branch 3 times, most recently from b81b687 to 10bdcc6 Compare January 27, 2018 16:33
@mvz mvz changed the title [WIP] Clean up sidebar plugins Clean up sidebar plugins Jan 27, 2018
@mvz
Copy link
Member Author

mvz commented Jan 27, 2018

This seemed like a good idea at the time, but now I'm not so sure.

@mvz mvz added the on hold label Jan 27, 2018
@mvz mvz mentioned this pull request Jan 27, 2018
@mvz mvz force-pushed the clean-up-sidebar-plugins branch from 3cce74b to eccd5cb Compare April 22, 2019 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants