Module Mack::Genosaurus::ActiveRecord::Helpers
In: lib/mack-active_record/genosaurus_helpers.rb

Methods

Public Instance methods

[Source]

    # File lib/mack-active_record/genosaurus_helpers.rb, line 6
 6:         def columns(name = param(:name))
 7:           ivar_cache("form_columns") do
 8:             cs = []
 9:             cols = (param(:cols) || param(:columns))
10:             if cols
11:               cols.split(",").each do |x|
12:                 cs << Mack::Genosaurus::ActiveRecord::ModelColumn.new(name, x)
13:               end
14:             end
15:             cs
16:           end
17:         end

[Source]

    # File lib/mack-active_record/genosaurus_helpers.rb, line 19
19:         def db_directory
20:           File.join(Mack.root, "db")
21:         end

[Source]

    # File lib/mack-active_record/genosaurus_helpers.rb, line 23
23:         def migrations_directory
24:           File.join(db_directory, "migrations")
25:         end

[Source]

    # File lib/mack-active_record/genosaurus_helpers.rb, line 27
27:         def next_migration_number
28:           last = Dir.glob(File.join(migrations_directory, "*.rb")).last
29:           if last
30:             return File.basename(last).match(/^\d+/).to_s.succ
31:           end
32:           return "001"
33:         end

[Validate]