lib/columns/model_data.rb in columns-0.1.1 vs lib/columns/model_data.rb in columns-0.2.0
- old
+ new
@@ -1,5 +1,7 @@
+require 'active_support/inflector'
+
module Columns
# Stores data about a model.
#
# Model name
@@ -29,12 +31,10 @@
# Public: Creates a new ModelData.
#
# raw_data - A RawData object.
def initialize(raw_data)
- # Ok, this is really idiot, I know, I know. Must use inflectors in
- # the future.
- @name = raw_data.name[0...-1]
+ @name = raw_data.name.singularize
contents = raw_data.content.split("\n")
contents.map! {|line| "# #{line.gsub(/^\s*t\./, '')}\n" }
@content = contents.join
end