Class: ArelConverter::Association
- Inherits:
-
Base
- Object
- Base
- ArelConverter::Association
show all
- Defined in:
- lib/arel_converter/association.rb
Instance Attribute Summary
Attributes inherited from Base
#options
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #parse_directory, #parse_file, #process_lines, #run!, #update_file
Instance Method Details
#grep_matches_in_file(file) ⇒ Object
4
5
6
7
|
# File 'lib/arel_converter/association.rb', line 4
def grep_matches_in_file(file)
raw_named_scopes = `grep -hr "^\s*has_\\|belongs_to" #{file}`
raw_named_scopes.split("\n")
end
|
#process_line(line) ⇒ Object
#verify_line(line) ⇒ Object
13
14
15
16
17
|
# File 'lib/arel_converter/association.rb', line 13
def verify_line(line)
parser = RubyParser.new
sexp = parser.process(line)
sexp.shift == :call
end
|