raydash 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,20 +9,24 @@ module Raydash
9
9
  desc "Generate a model for working with video tokens"
10
10
  source_root File.expand_path("../../templates", __FILE__)
11
11
  def manifest
12
- #record do |m|
13
- migration_template 'migration.rb', "db/migrate", {:assigns => raydash_local_assigns(),
14
- :migration_file_name => 'create_raydash_table_#{custom_name}'
12
+ @custom_name=custom_file_name
13
+ @class_name = class_name.capitalize
14
+ migration_template 'migration.rb', "db/migrate/#{custom_file_name}", {:assigns => raydash_local_assigns(),
15
+ :migration_file_name => 'create_raydash_table_#{custom_file_name}'
15
16
  }
16
- #end
17
17
  end
18
18
  def model
19
19
  @custom_name=custom_file_name
20
+ @class_name = class_name.capitalize
20
21
  template "model.rb", "app/models/#{custom_file_name}.rb"
21
22
  end
22
23
  private
23
24
  def custom_file_name
24
- custom_name = class_name.underscore.downcase
25
- custom_name = custom_name.pluralize if ActiveRecord::Base.pluralize_table_names
25
+ class_name.underscore.downcase
26
+ end
27
+ def custom_name
28
+ custom_name = class_name.underscore.downcase
29
+ custom_name = custom_name.pluralize if ActiveRecord::Base.pluralize_table_names
26
30
  end
27
31
  def self.next_migration_number(dirname)
28
32
  if ActiveRecord::Base.timestamped_migrations
@@ -1,4 +1,4 @@
1
- class <%= @name %> < ActiveRecord::Migration
1
+ class <%= @class_name %> < ActiveRecord::Migration
2
2
  def self.up
3
3
  create_table :<%= @name %> do |t|
4
4
  t.string :token
@@ -1,4 +1,4 @@
1
- class <%= @custom_name %> < ActiveRecord::Base
1
+ class <%= @class_name %> < ActiveRecord::Base
2
2
  before_create :generate_token
3
3
 
4
4
  def point_to(otherToken)
@@ -1,3 +1,3 @@
1
1
  module Raydash
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raydash
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gershon Bialer
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-12 00:00:00 -06:00
18
+ date: 2011-02-13 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies: []
21
21