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

Configurable search scope name #71

Closed
wants to merge 5 commits into from

Conversation

ernsheong
Copy link

Add configuration scope name for search to avoid naming conflict

@@ -12,7 +12,8 @@ module ClassMethods
def initialize_scopes
scope :are_from, lambda { |*args| where(:sent_messageable_id => args.first, :sent_messageable_type => args.first.class.name) }
scope :are_to, lambda { |*args| where(:received_messageable_id => args.first, :received_messageable_type => args.first.class.name) }
scope :search, lambda { |*args| where("body like :search_txt or topic like :search_txt",:search_txt => "%#{args.first}%")}
scope ActsAsMessageable.search_scope_name,
lambda { |*args| where("body like :search_txt or topic like :search_txt",:search_txt => "%#{args.first}%")}

Choose a reason for hiding this comment

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

Line is too long. [142/80]
Align the parameters of a method call if they span more than one line.
Use the new Ruby 1.9 hash syntax.
Space missing after comma.
Space missing inside }.

@ernsheong
Copy link
Author

Addresses #62

scope :search, lambda { |*args| where("body like :search_txt or topic like :search_txt",:search_txt => "%#{args.first}%")}
scope :connected_with, lambda { |*args| where("(sent_messageable_type = :sent_type and
scope ActsAsMessageable.search_scope_name,
lambda { |*args| where("body like :search_txt or topic like :search_txt", :search_txt => "%#{args.first}%") }

Choose a reason for hiding this comment

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

Line is too long. [143/80]
Align the parameters of a method call if they span more than one line.
Use the new Ruby 1.9 hash syntax.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.11%) when pulling e80e914 on ernsheong:configurable-search-scope into 9fa40fa on LTe:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.11%) when pulling 5ddd8bd on ernsheong:configurable-search-scope into 9fa40fa on LTe:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.11%) when pulling 794d9fa on ernsheong:configurable-search-scope into 9fa40fa on LTe:master.

@ernsheong
Copy link
Author

Looks like it's still failing. Some pointers or comments on how to improve would be welcome

@ernsheong ernsheong closed this Feb 16, 2016
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.

3 participants