friendly_id 3.1.2 → 3.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,6 +6,12 @@ suggestions, ideas and improvements to FriendlyId.
6
6
  * Table of Contents
7
7
  {:toc}
8
8
 
9
+ ## 3.1.3 (2010-08-11)
10
+
11
+ * Reverted approach to read-only fix from previous release.
12
+ See [this commit](http://github.com/norman/friendly_id/commit/e263f74e446c1e4d95901e9e8d7d6713c078c38e)
13
+ for details.
14
+
9
15
  ## 3.1.2 (2010-08-11)
10
16
 
11
17
  * Fixed records being returned read-only. (Thanks Luis Lavena)
data/Rakefile CHANGED
@@ -51,10 +51,11 @@ end
51
51
 
52
52
  task :pushdocs do
53
53
  branch = `git branch | grep "*"`.chomp.gsub("* ", "")
54
+ sh "git stash"
54
55
  sh "git checkout gh-pages"
55
- sh "rm -rf FriendlyId ActiveRecord css js *.html"
56
56
  sh "cp -rp doc/* ."
57
57
  sh 'git commit -a -m "Regenerated docs"'
58
58
  sh "git push origin gh-pages"
59
59
  sh "git checkout #{branch}"
60
+ sh "git stash apply"
60
61
  end
@@ -36,11 +36,12 @@ module FriendlyId
36
36
  parse_ids!
37
37
  scope = some_friendly_scope
38
38
  if use_slugs? && @friendly_ids.present?
39
- scope = scope.scoped(:include => :slugs)
39
+ scope = scope.scoped(:joins => :slugs)
40
40
  if fc.scope?
41
41
  scope = scope.scoped(:conditions => {:slugs => {:scope => scope_val}})
42
42
  end
43
43
  end
44
+ options[:readonly] = false unless options[:readonly]
44
45
  @result = scope.all(options).uniq
45
46
  validate_expected_size!
46
47
  @result.each { |record| record.friendly_id_status.name = id }
@@ -62,8 +63,9 @@ module FriendlyId
62
63
 
63
64
  def find_one_using_slug
64
65
  name, seq = id.to_s.parse_friendly_id
65
- scope = scoped(:include => :slugs, :conditions => {:slugs => {:name => name, :sequence => seq}})
66
+ scope = scoped(:joins => :slugs, :conditions => {:slugs => {:name => name, :sequence => seq}})
66
67
  scope = scope.scoped(:conditions => {:slugs => {:scope => scope_val}}) if fc.scope?
68
+ options[:readonly] = false unless options[:readonly]
67
69
  @result = scope.first(options)
68
70
  assign_status
69
71
  end
@@ -2,7 +2,7 @@ module FriendlyId
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 1
5
- TINY = 2
5
+ TINY = 3
6
6
  BUILD = nil
7
7
  STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
8
8
  end
@@ -0,0 +1,6 @@
1
+ adapter: postgresql
2
+ host: localhost
3
+ port: 5432
4
+ username: postgres
5
+ database: friendly_id_test
6
+ encoding: utf8
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 3
7
7
  - 1
8
- - 2
9
- version: 3.1.2
8
+ - 3
9
+ version: 3.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Norman Clarke
@@ -92,6 +92,7 @@ files:
92
92
  - test/active_record_adapter/support/database.mysql.yml
93
93
  - test/active_record_adapter/support/database.postgres.yml
94
94
  - test/active_record_adapter/support/database.sqlite3.yml
95
+ - test/active_record_adapter/support/database.yml
95
96
  - test/active_record_adapter/support/models.rb
96
97
  - test/active_record_adapter/tasks_test.rb
97
98
  - test/friendly_id_test.rb