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

Develop #7

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

Develop #7

wants to merge 6 commits into from

Conversation

isaacchansky
Copy link
Owner

No description provided.

# so we can compose a larger query of something like:
# title ILIKE ? OR title ILIKE ?
query_chunks = model_attributes.map{|attr|
Array.new(search_terms.count){ "#{attr.to_s} #{operator} ?" }.join(' OR ')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Redundant use of Object#to_s in interpolation.
Space missing to the left of {.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.


# Set up DB
DataMapper.setup(:default, ENV["DATABASE_URL"] || "#{ENV["DB_ADAPTER"]}://#{ENV["DB_HOSTNAME"]}/#{ENV["DB_NAME"]}")
DataMapper.setup(:default, ENV['DATABASE_URL'] || 'postgres://localhost/agora')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Line is too long. [81/80]
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

console.log('Welcome to the api demo!')

function friendlyDate (datestring) {
var d = new Date(datestring)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missing semicolon.

get "/search" do

# search for terms in description and title
search_results = Event.full_text_search(params[:q], [:description, :title]).sort_by(&:start_date).reverse
Copy link
Collaborator

Choose a reason for hiding this comment

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

Line is too long. [111/80]

end


Copy link
Collaborator

Choose a reason for hiding this comment

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

Extra blank line detected.

end


Copy link
Collaborator

Choose a reason for hiding this comment

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

Extra blank line detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants