Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 2450 globalize #2462

Merged
merged 3 commits into from
Nov 18, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion authentication/refinerycms-authentication.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require File.expand_path('../../core/lib/refinery/version', __FILE__)

version = Refinery::Version.to_s
rails_version = ['>= 3.1.3', '< 3.3']
rails_version = ['>= 3.1.11', '< 3.3'] | 0.upto(11).map{|i| "!= 3.2.#{i}"}

Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
Expand Down
7 changes: 5 additions & 2 deletions pages/app/models/refinery/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Translation
attr_accessible *::SeoMeta.attributes.keys, :locale
end

# Delegate SEO Attributes to globalize3 translation
# Delegate SEO Attributes to globalize translation
seo_fields = ::SeoMeta.attributes.keys.map{|a| [a, :"#{a}="]}.flatten
delegate(*(seo_fields << {:to => :translation}))

Expand Down Expand Up @@ -51,7 +51,10 @@ class Translation

accepts_nested_attributes_for :parts, :allow_destroy => true

before_save { |m| m.translation.save }
before_save do |m|
m.translation.globalized_model = self
m.translation.save if m.translation.new_record?
end
before_create :ensure_locale!
before_destroy :deletable?
after_save :reposition_parts!
Expand Down
2 changes: 1 addition & 1 deletion pages/lib/refinery/pages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module Admin

ActiveSupport.on_load(:active_record) do
require 'awesome_nested_set'
require 'globalize3'
require 'globalize'
end
require 'friendly_id'
require 'seo_meta'
Expand Down
2 changes: 1 addition & 1 deletion pages/refinerycms-pages.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- spec/*`.split("\n")

s.add_dependency 'friendly_id', '~> 4.0.9'
s.add_dependency 'globalize3', '~> 0.3.0'
s.add_dependency 'globalize', '~> 3.0.1'
s.add_dependency 'awesome_nested_set', '~> 2.1.3'
s.add_dependency 'seo_meta', '~> 1.4.0'
s.add_dependency 'refinerycms-core', version
Expand Down