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

Fixed misspelling of Active (was Acive). Superficial, but important. #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/engrel.rb
Expand Up @@ -23,7 +23,7 @@ def sentence(*args, &block)
alias :fact :sentence
alias :claim :sentence

module AciveRecordInstanceMethods
module ActiveRecordInstanceMethods
# Helper method that gets included into AR::Base that allows any model object to specify a relationship between it and any other
# object (the direct object (they're both polymorphic, of course).
#
Expand All @@ -41,5 +41,5 @@ def fact(verb, direct_object, &block)
end


ActiveRecord::Base.send(:include, ::Engrel::Helpers::AciveRecordInstanceMethods) if (defined?(ActiveRecord::Base) rescue false)
ActiveRecord::Base.send(:include, ::Engrel::Helpers::ActiveRecordInstanceMethods) if (defined?(ActiveRecord::Base) rescue false)
include ::Engrel::Helpers
5 changes: 3 additions & 2 deletions lib/engrel/sentence.rb
Expand Up @@ -124,9 +124,10 @@ def to_sentence_colored
sen
end

# TODO: Properly strip ANSI color chars
def to_sentence
to_sentence_colored
# stripping ANSI is just removing from the pair ESC and [ up
# to the lowercase letter m, lazily.
to_sentence_colored.gsub(/\x1B\[.*?m/, "");
end
end