model_discovery 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bae622dc39af8def28fd7f52393d1514ef97a9c4
4
- data.tar.gz: ebe05cba1a33fe98c26eec02cb0357da6f287f24
3
+ metadata.gz: 7b161d912d9109915b5fac1d8ca600a69f6c5ed9
4
+ data.tar.gz: 7454737a5d3c473b91f9d6165354b909456f3f81
5
5
  SHA512:
6
- metadata.gz: 3c19843b87308806aa1e2fef9d4bdc9bd0d6fdbca9ae0b693e245a9d3698c486c2b2ee4e623f06f9f2b042ed447d51003e68cc8ca67534b694dfdb040f7cf946
7
- data.tar.gz: 590422f7a642fccc62ec54a6b94c96eb51d0099892c61ffe53780410fc6fa4776206e3ded9a22651d86fc3c31bb96f70cddcde5e55013216983cb211ca46bd69
6
+ metadata.gz: c56e1fe67ee2225cfdfeb65b0b0c1b4463fa432f71e8ebfe2bc38c1a892d04e37224f286633389451048ec28362a8dcd439d8156a62133ad1e5b67a7c09896c7
7
+ data.tar.gz: a9d24a628ce9244e1a066aa9e04ecd48457f84f7cd40c1521c894dd5e6da9a17a0b95be8be4ae01f7d49a6702ce14aa33315903b593b136df864ed81e98a2791
@@ -17,7 +17,7 @@ module ModelDiscovery
17
17
 
18
18
  # Create a content type entry for all Models
19
19
  ActiveRecord::Base.subclasses.each do |model|
20
- ApplicationModels.create(:model => model.to_s)
20
+ ApplicationModels.find_or_create_by_model(model.to_s)
21
21
  end
22
22
  end
23
23
 
@@ -1,3 +1,3 @@
1
1
  module ModelDiscovery
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -2,3 +2,10 @@
2
2
  # task :model_discovery do
3
3
  # # Task goes here
4
4
  # end
5
+ namespace :model_discovery do
6
+ desc "Re-Sync models"
7
+ task :sync => :environment do
8
+ require 'model_discovery'
9
+ ModelDiscovery.build_table_list
10
+ end
11
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_discovery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sameer Rahmani
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-01 00:00:00.000000000 Z
11
+ date: 2014-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails