restfulx 1.2.5 → 1.3.0

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.
Files changed (52) hide show
  1. data/README.rdoc +3 -3
  2. data/Rakefile +17 -2
  3. data/VERSION.yml +2 -3
  4. data/bin/rx-gen +1 -1
  5. data/ext/restfulx/ext/amf/serializer/extconf.rb +3 -0
  6. data/lib/restfulx.rb +43 -81
  7. data/lib/restfulx/active_record_tasks.rb +8 -6
  8. data/lib/restfulx/active_record_uuid_helper.rb +9 -10
  9. data/lib/restfulx/amf.rb +14 -0
  10. data/lib/restfulx/amf/class_mapping.rb +106 -0
  11. data/lib/restfulx/amf/ext.rb +11 -0
  12. data/lib/restfulx/amf/ext/serializer.bundle +0 -0
  13. data/lib/restfulx/amf/pure.rb +11 -0
  14. data/lib/restfulx/amf/pure/io_helpers.rb +52 -0
  15. data/lib/restfulx/amf/pure/serializer.rb +304 -0
  16. data/lib/restfulx/configuration.rb +16 -12
  17. data/lib/restfulx/{rails/recipes.rb → recipes.rb} +1 -2
  18. data/lib/restfulx/rx_action_controller.rb +34 -0
  19. data/lib/restfulx/rx_active_record.rb +360 -0
  20. data/lib/restfulx/rx_active_support.rb +139 -0
  21. data/lib/restfulx/{datamapper_foo.rb → rx_datamapper.rb} +0 -2
  22. data/lib/restfulx/{rails/schema_to_yaml.rb → schema_to_rx_yaml.rb} +88 -5
  23. data/lib/restfulx/swf_helper.rb +61 -0
  24. data/lib/restfulx/tasks.rb +5 -3
  25. data/rails_generators/rx_config/rx_config_generator.rb +2 -2
  26. data/rails_generators/rx_config/templates/mainapp.mxml +1 -1
  27. data/rails_generators/rx_config/templates/restfulx.erb +5 -3
  28. data/rails_generators/rx_main_app/rx_main_app_generator.rb +2 -2
  29. data/rails_generators/rx_scaffold/rx_scaffold_generator.rb +7 -7
  30. data/rails_generators/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb +5 -3
  31. data/rxgen_generators/rx_config/rx_config_generator.rb +1 -1
  32. data/test/rails/fixtures/locations.yml +5 -6
  33. data/test/rails/fixtures/notes.yml +5 -15
  34. data/test/rails/fixtures/projects.yml +7 -23
  35. data/test/rails/fixtures/tasks.yml +17 -43
  36. data/test/rails/fixtures/users.yml +7 -11
  37. data/test/rails/helpers/functional_test_helper.rb +5 -4
  38. data/test/rails/helpers/performance_test_helper.rb +5 -0
  39. data/test/rails/helpers/test_helper.rb +27 -0
  40. data/test/rails/helpers/unit_test_helper.rb +3 -15
  41. data/test/rails/test_active_foo.rb +21 -25
  42. data/test/rails/{test_rails_integration_functional.rb → test_notes_controller_functional.rb} +5 -5
  43. data/test/rails/test_serialiazation_performance.rb +32 -0
  44. data/test/rails/test_to_amf.rb +30 -0
  45. data/test/rails/test_to_fxml.rb +18 -15
  46. data/test/rails/test_to_json.rb +2 -14
  47. metadata +30 -19
  48. data/lib/restfulx/active_foo.rb +0 -178
  49. data/lib/restfulx/rails/schema_to_yaml/extensions/enumerable.rb +0 -8
  50. data/lib/restfulx/rails/schema_to_yaml/settings/config.rb +0 -17
  51. data/lib/restfulx/rails/schema_to_yaml/settings/core.rb +0 -73
  52. data/lib/restfulx/rails/swf_helper.rb +0 -59
@@ -0,0 +1,139 @@
1
+ # There's a number of things that ActiveRecord/ActiveSupport and the rest of the family get
2
+ # ~wrong~ from the point of view of Flex clients.
3
+ #
4
+ # Some of these things are:
5
+ # * XML format (Flex *really* doesn't like dashes in XML messages)
6
+ # * Errors (we need to be more specific and communicate what went wrong *where*)
7
+ #
8
+ # This is where we try to fix this stuff.
9
+ #
10
+ # Some of the things that are done can be called _monkey_ _patching_ while others can
11
+ # be called extensions. Caveat emptor.
12
+
13
+ # ActiveSupport specific patches. More specifically we add +to_fxml+ and +to_amf+ methods to Array and
14
+ # Hash conversion modules
15
+ module ActiveSupport::CoreExtensions
16
+ # Add Flex friendly +to_fxml+ and +to_amf+ to Hash conversions
17
+ module Hash
18
+ # refer to: http://api.rubyonrails.org/ for more details
19
+ module Conversions
20
+ # Flex friendly XML format, no dashes, etc
21
+ def to_fxml(options = {})
22
+ options.merge!(:dasherize => false)
23
+ options[:indent] ||= 2
24
+ options.reverse_merge!({ :builder => Builder::XmlMarkup.new(:indent => options[:indent]),
25
+ :root => "hash" })
26
+ options[:builder].instruct! unless options.delete(:skip_instruct)
27
+ dasherize = !options.has_key?(:dasherize) || options[:dasherize]
28
+ root = dasherize ? options[:root].to_s.dasherize : options[:root].to_s
29
+
30
+ options[:builder].__send__(:method_missing, root) do
31
+ each do |key, value|
32
+ case value
33
+ when ::Hash
34
+ value.to_fxml(options.merge({ :root => key, :skip_instruct => true }))
35
+ when ::Array
36
+ value.to_fxml(options.merge({ :root => key, :children => key.to_s.singularize, :skip_instruct => true}))
37
+ when ::Method, ::Proc
38
+ # If the Method or Proc takes two arguments, then
39
+ # pass the suggested child element name. This is
40
+ # used if the Method or Proc will be operating over
41
+ # multiple records and needs to create an containing
42
+ # element that will contain the objects being
43
+ # serialized.
44
+ if 1 == value.arity
45
+ value.call(options.merge({ :root => key, :skip_instruct => true }))
46
+ else
47
+ value.call(options.merge({ :root => key, :skip_instruct => true }), key.to_s.singularize)
48
+ end
49
+ else
50
+ if value.respond_to?(:to_fxml)
51
+ value.to_fxml(options.merge({ :root => key, :skip_instruct => true }))
52
+ else
53
+ type_name = XML_TYPE_NAMES[value.class.name]
54
+
55
+ key = dasherize ? key.to_s.dasherize : key.to_s
56
+
57
+ attributes = options[:skip_types] || value.nil? || type_name.nil? ? { } : { :type => type_name }
58
+ if value.nil?
59
+ attributes[:nil] = true
60
+ end
61
+
62
+ options[:builder].tag!(key,
63
+ XML_FORMATTING[type_name] ? XML_FORMATTING[type_name].call(value) : value,
64
+ attributes
65
+ )
66
+ end
67
+ end
68
+ end
69
+
70
+ yield options[:builder] if block_given?
71
+ end
72
+ end
73
+
74
+ # serialize as AMF
75
+ def to_amf(options = {})
76
+ RestfulX::AMF.serialize_property(self, {:serializable_names => self.keys, :options => options})
77
+ end
78
+ end
79
+ end
80
+
81
+ module Array
82
+ # refer to: http://api.rubyonrails.org/ for more details
83
+ module Conversions
84
+ # Flex friendly XML format (no dashes, etc)
85
+ def to_fxml(options = {})
86
+ raise "Not all elements respond to to_fxml" unless all? { |e| e.respond_to? :to_fxml }
87
+
88
+ options[:root] ||= all? { |e| e.is_a?(first.class) && first.class.to_s != "Hash" } ? first.class.to_s.underscore.pluralize : "records"
89
+ options[:children] ||= options[:root].singularize
90
+ options[:indent] ||= 2
91
+ options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent])
92
+ options.merge!(:dasherize => false)
93
+
94
+ options[:attributes] ||= {}
95
+ options[:attributes].merge!(:type => "array")
96
+
97
+ root = options.delete(:root).to_s
98
+ children = options.delete(:children)
99
+
100
+ if !options.has_key?(:dasherize) || options[:dasherize]
101
+ root = root.dasherize
102
+ end
103
+
104
+ options[:builder].instruct! unless options.delete(:skip_instruct)
105
+
106
+ opts = options.merge({ :root => children })
107
+
108
+ xml = options[:builder]
109
+ if empty?
110
+ xml.tag!(root, options[:attributes])
111
+ else
112
+ xml.tag!(root, options[:attributes]) {
113
+ yield xml if block_given?
114
+ each { |e| e.to_fxml(opts.merge!({ :skip_instruct => true })) }
115
+ }
116
+ end
117
+ end
118
+
119
+ # Serialize as AMF
120
+ def to_amf(options = {})
121
+ raise "Not all elements respond to to_amf" unless all? { |e| e.respond_to? :to_amf }
122
+
123
+ options[:attributes] ||= {}
124
+ options[:serializer] ||= RestfulX::AMF::RxAMFSerializer.new
125
+ options[:serializer].serialize_typed_array(self, options).to_s
126
+ end
127
+ end
128
+ end
129
+ end
130
+
131
+ class Array
132
+ alias_method :to_json_original, :to_json
133
+
134
+ # Serialize array as RestfulX friendly JSON (with metadata)
135
+ def to_json(options = {})
136
+ attributes = options.delete(:attributes)
137
+ return (attributes.nil?) ? to_json_original(options) : "[{#{'metadata'.inspect}: #{attributes.to_json}},#{to_json_original(options)[1..-1]}]"
138
+ end
139
+ end
@@ -2,11 +2,9 @@
2
2
  # ValidationErrors class
3
3
  require 'dm-serializer/common'
4
4
  require 'dm-serializer/xml_serializers'
5
- require File.join(File.dirname(__FILE__), '..', 'lib', 'restfulx') if !defined?(RestfulX)
6
5
 
7
6
  # RestfulX datamapper patches
8
7
  module DataMapper
9
-
10
8
  # Monkey patches dm-serialization to_json method to add ruby_class: YourClass
11
9
  # to all serialized objects
12
10
  module Serialize
@@ -1,10 +1,92 @@
1
1
  # Used for analyzing your schema and exporting a model.yml file for Rx
2
2
  # Provides facilities to convert an existing Rails application schema.rb file to
3
3
  # RestfulX model.yml file
4
- module SchemaToYaml
5
- # SchemaToYaml.schema_to_yaml
4
+ module SchemaToRxYaml
5
+ module Settings
6
+ APP_ROOT = defined?(RAILS_ROOT) ? RAILS_ROOT : File.expand_path(".")
7
+
8
+ class Config
9
+ class << self
10
+ def configure
11
+ yield self
12
+ end
13
+
14
+ def settings_file
15
+ @settings_file ||= :restfulx
16
+ end
17
+ attr_writer :settings_file
18
+ end
19
+ end
20
+
21
+ class Core
22
+ class << self
23
+ def name
24
+ instance._settings.key?("name") ? instance.name : super
25
+ end
26
+
27
+ def reset!
28
+ @instance = nil
29
+ end
30
+
31
+ private
32
+ def instance
33
+ @instance ||= new
34
+ end
35
+
36
+ def method_missing(name, *args, &block)
37
+ instance.send(name, *args, &block)
38
+ end
39
+ end
40
+
41
+ attr_accessor :_settings
42
+
43
+ def initialize(name_or_hash = Config.settings_file)
44
+ case name_or_hash
45
+ when Hash
46
+ self._settings = name_or_hash
47
+ when String, Symbol
48
+ root_path = defined?(RestfulX::Configuration::APP_ROOT) ? "#{RestfulX::Configuration::APP_ROOT}/config/" : ""
49
+ file_path = name_or_hash.is_a?(Symbol) ? "#{root_path}#{name_or_hash}.yml" : name_or_hash
50
+ self._settings = YAML.load(ERB.new(File.read(file_path)).result)
51
+ self._settings = _settings[RAILS_ENV] if defined?(RAILS_ENV)
52
+ else
53
+ raise ArgumentError.new("Your settings must be a hash,
54
+ a symbol representing the name of the .yml file in your config directory,
55
+ or a string representing the abosolute path to your settings file.")
56
+ end
57
+ define_settings!
58
+ end
59
+
60
+ private
61
+ def method_missing(name, *args, &block)
62
+ raise NoMethodError.new("no configuration was specified for #{name}")
63
+ end
64
+
65
+ def define_settings!
66
+ return if _settings.nil?
67
+ _settings.each do |key, value|
68
+ case value
69
+ when Hash
70
+ instance_eval <<-"end_eval", __FILE__, __LINE__
71
+ def #{key}
72
+ @#{key} ||= self.class.new(_settings["#{key}"])
73
+ end
74
+ end_eval
75
+ else
76
+ instance_eval <<-"end_eval", __FILE__, __LINE__
77
+ def #{key}
78
+ @#{key} ||= _settings["#{key}"]
79
+ end
80
+ end_eval
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end
86
+
87
+ # SchemaToRxYaml.schema_to_rx_yaml
6
88
  # - set of commands that introspects your database and formats your model.yml for export
7
- def self.schema_to_yaml
89
+ def self.schema_to_rx_yaml
8
90
  # Iterates through your database, and sets up table_arr with all columns
9
91
  # - excludes schema_info/schema_migrations/and any other tables you specify in restfulx.yml
10
92
  table_arr = ActiveRecord::Base.connection.tables -
@@ -83,6 +165,7 @@ module SchemaToYaml
83
165
  # Appends belong_to's to schema
84
166
  if belong_tos.size > 0
85
167
  belong_tos = belong_tos.delete_if {|x| x == "#{@polymorphic}, " }
168
+ break if belong_tos.size == 0 # fixing to get around nil error when you only have one polymorphic belong_to
86
169
  last_in_array_fix = belong_tos.last
87
170
  last_in_array_fix = last_in_array_fix.gsub(', ','')
88
171
  belong_tos.pop
@@ -93,7 +176,7 @@ module SchemaToYaml
93
176
  # Appends has_manies' to schema
94
177
  if has_manies.size > 0
95
178
  last_in_array_fix = has_manies.last
96
- last_in_array_fix = last_in_array_fix.gsub(', ','')
179
+ last_in_array_fix = last_in_array_fix.gsub(', ','') unless last_in_array_fix.nil?
97
180
  has_manies.pop
98
181
  has_manies << last_in_array_fix
99
182
  schema << " - has_many: [#{has_manies}]\n"
@@ -105,6 +188,6 @@ module SchemaToYaml
105
188
  # Writes model.yml file
106
189
  yml_file = File.join(RAILS_ROOT, "db", "model.yml")
107
190
  File.open(yml_file, "w") { |f| f << schema.to_s }
108
- puts "Model.yml created at db/model.yml"
191
+ puts "model.yml created at db/model.yml"
109
192
  end
110
193
  end
@@ -0,0 +1,61 @@
1
+ # Adds a little helper to make it easier empbedding SWFs in ERB templates.
2
+ module RestfulX
3
+ module SWFHelper
4
+ # Creates a swfObject Javascript call. You must include swfobject.js to use this.
5
+ # See http://code.google.com/p/swfobject/wiki/documentation for full details and documentation
6
+ # of the swfobject js library.
7
+ def swfobject(swf_url, params = {})
8
+ params.reverse_merge!({:width => '100%',
9
+ :height => '100%',
10
+ :id => 'flashContent',
11
+ :version => '9.0.0',
12
+ :express_install_swf => '/expressInstall.swf',
13
+ :flash_vars => nil,
14
+ :params => { },
15
+ :attributes => { },
16
+ :create_div => false,
17
+ :include_authenticity_token => true,
18
+ :include_session_token => true
19
+ })
20
+ arg_order = [:id, :width, :height, :version, :express_install_swf]
21
+ js_params = ["'#{swf_url}'"]
22
+ js_params += arg_order.collect {|arg| "'#{params[arg]}'" }
23
+
24
+ # Add authenticity_token and the session key to flashVars. This will only work if flashVars is a Hash or nil
25
+ # If it's a string representing the name of a Javascript variable, then you need to add them yourself
26
+ # like this:
27
+ # <script>
28
+ # ... other code that defines flashVars and sets some of its parameters
29
+ # flashVars['authenticity_token'] = <%= form_authenticity_token -%>
30
+ # flashVars['session_token'] = <%= session.session_id -%>
31
+ # </script>
32
+ params[:flash_vars] ||= {}
33
+ if params[:flash_vars].is_a?(Hash)
34
+ if params[:include_authenticity_token] && ::ActionController::Base.allow_forgery_protection
35
+ params[:flash_vars].reverse_merge!(:authenticity_token => form_authenticity_token)
36
+ end
37
+ if params[:include_session_token]
38
+ if RAILS_GEM_VERSION =~ /^2.3/
39
+ params[:flash_vars].reverse_merge!(:session_token => request.session_options[:id])
40
+ else
41
+ params[:flash_vars].reverse_merge!(:session_token => session.session_id)
42
+ end
43
+ end
44
+ end
45
+
46
+ js_params += [params[:flash_vars], params[:params], params[:attributes]].collect do |hash_or_string|
47
+ if hash_or_string.is_a?(Hash)
48
+ hash_or_string.to_json
49
+ else # If it's not a hash, then it should be a string giving the name of the Javascript variable to use
50
+ hash_or_string
51
+ end
52
+ end.compact
53
+
54
+ swf_tag = javascript_tag do
55
+ "swfobject.embedSWF(#{js_params.join(',')})"
56
+ end
57
+ swf_tag += content_tag(:div, nil, :id => params[:id]) if params[:create_div]
58
+ swf_tag
59
+ end
60
+ end
61
+ end
@@ -1,8 +1,9 @@
1
1
  # Rake tasks for building RestfulX-based Flex and AIR applications
2
+ $:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
2
3
  require 'rake'
3
4
  require 'rexml/document'
4
5
  require 'activesupport'
5
- require File.join(File.dirname(__FILE__), 'configuration')
6
+ require 'configuration'
6
7
 
7
8
  include RestfulX::Configuration
8
9
 
@@ -33,7 +34,8 @@ namespace :rx do
33
34
 
34
35
  libs = Dir.glob(File.join(APP_ROOT, 'lib', '*.swc')).map {|lib| lib.gsub(' ', '\ ')}
35
36
 
36
- additional_compiler_args = get_app_properties().elements["actionScriptProperties"].elements["compiler"].attributes["additionalCompilerArguments"]
37
+ additional_compiler_args =
38
+ get_app_properties().elements["actionScriptProperties"].elements["compiler"].attributes["additionalCompilerArguments"]
37
39
  additional_compiler_args.gsub!("../locale/", "#{APP_ROOT}/app/locale/")
38
40
 
39
41
  cmd = "#{executable} #{opts} -library-path+=#{libs.join(',')} " << additional_compiler_args << " #{project_path.gsub(' ', '\ ')}"
@@ -98,7 +100,7 @@ namespace :rx do
98
100
 
99
101
  namespace :air do
100
102
  desc "Build project swf file as an AIR application and move it into bin-debug folder"
101
- task :build do
103
+ task :build do
102
104
  compile_application(:destination => 'bin-debug', :opts => '+configname=air')
103
105
  end
104
106
 
@@ -93,7 +93,7 @@ class RxConfigGenerator < Rails::Generator::Base
93
93
 
94
94
  m.directory "#{flex_root}/#{base_folder}/views/generated"
95
95
 
96
- framework_release = RestfulX::FRAMEWORK_VERSION
96
+ framework_release = RestfulX::VERSION
97
97
  framework_distribution_url = "http://restfulx.github.com/releases/restfulx-#{framework_release}.swc"
98
98
  framework_destination_file = "lib/restfulx-#{framework_release}.swc"
99
99
 
@@ -119,7 +119,7 @@ class RxConfigGenerator < Rails::Generator::Base
119
119
 
120
120
  m.template 'index.erb', 'app/views/flex/index.html.erb'
121
121
 
122
- m.file 'routes.erb', 'config/routes.rb', :collision => :ask
122
+ m.file 'routes.erb', 'config/routes.rb', :collision => options[:collision]
123
123
 
124
124
  FileUtils.rm 'public/index.html' if File.exist?('public/index.html')
125
125
 
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <mx:<%= application_tag %> xmlns:mx="http://www.adobe.com/2006/mxml"
3
- xmlns:generated="<%= base_package %>.components.generated.*"
3
+ xmlns:generated="<%= base_package %>.views.generated.*"
4
4
  paddingBottom="8" paddingLeft="8" paddingRight="8" paddingTop="8"
5
5
  layout="horizontal" styleName="plain" initialize="init()">
6
6
  <mx:Script>
@@ -30,8 +30,10 @@ class FlexNestedAttributeMiddleware
30
30
  if req && req.path_info =~ /\.fxml$/
31
31
  if req.put? || req.post? || req.delete?
32
32
  req.params.each do |key,value|
33
- value.select { |k,v| k =~ /\_attributes$/ }.each do |match|
34
- env['rack.request.form_hash'][key][match[0]] = ActiveSupport::JSON.decode(match[1])
33
+ if value.respond_to? :select
34
+ value.select { |k,v| k =~ /\_attributes$/ }.each do |match|
35
+ env['rack.request.form_hash'][key][match[0]] = ActiveSupport::JSON.decode(match[1])
36
+ end
35
37
  end
36
38
  end
37
39
  end
@@ -72,4 +74,4 @@ ActionController::Base.allow_forgery_protection = false
72
74
  <% if distributed -%>
73
75
  # If we are in distributed mode we need to make sure that the RestfulX::UUIDHelper is loaded
74
76
  require "restfulx/active_record_uuid_helper"
75
- <% end -%>
77
+ <% end -%>
@@ -4,7 +4,7 @@ module Rails
4
4
  module Generator
5
5
  module Commands
6
6
  class Create
7
- include SchemaToYaml
7
+ include SchemaToRxYaml
8
8
  end
9
9
  end
10
10
  end
@@ -50,7 +50,7 @@ class RxMainAppGenerator < Rails::Generator::Base
50
50
 
51
51
  def manifest
52
52
  record do |m|
53
- m.template 'mainapp.mxml', File.join("#{flex_root}", "#{flex_project_name}.mxml")
53
+ m.template 'mainapp.mxml', File.join("#{flex_root}", "#{flex_project_name}.mxml"), :collision => options[:collision]
54
54
  end
55
55
  end
56
56
 
@@ -63,7 +63,7 @@ module Rails
63
63
  end
64
64
  module Commands
65
65
  class Create
66
- include SchemaToYaml
66
+ include SchemaToRxYaml
67
67
  end
68
68
  end
69
69
  end
@@ -71,7 +71,7 @@ end
71
71
 
72
72
  class RxScaffoldGenerator < Rails::Generator::NamedBase
73
73
  include RestfulX::Configuration
74
- include SchemaToYaml
74
+ include SchemaToRxYaml
75
75
 
76
76
  attr_reader :project_name,
77
77
  :flex_project_name,
@@ -129,22 +129,22 @@ class RxScaffoldGenerator < Rails::Generator::NamedBase
129
129
  unless options[:flex_view_only]
130
130
  m.template 'model.as.erb',
131
131
  File.join("#{@flex_root}", base_folder, "models", "#{@class_name}.as"),
132
- :assigns => { :resource_controller_name => "#{file_name.pluralize}" }
132
+ :assigns => { :resource_controller_name => "#{file_name.pluralize}" }, :collision => options[:collision]
133
133
 
134
134
  m.template "controllers/#{RxSettings.controller_pattern}.rb.erb", File.join("app/controllers",
135
- controller_class_path, "#{controller_file_name}_controller.rb") unless options[:flex_only]
135
+ controller_class_path, "#{controller_file_name}_controller.rb"), :collision => options[:collision] unless options[:flex_only]
136
136
 
137
- m.template 'model.rb.erb', File.join("app", "models", "#{file_name}.rb") unless options[:flex_only]
137
+ m.template 'model.rb.erb', File.join("app", "models", "#{file_name}.rb"), :collision => options[:collision] unless options[:flex_only]
138
138
  end
139
139
 
140
140
  if @layout.size > 0
141
141
  m.template "layouts/#{@layout}.erb",
142
142
  File.join("#{@flex_root}", base_folder, "views", "generated", "#{@class_name}Box.mxml"),
143
- :assigns => { :resource_controller_name => "#{file_name.pluralize}" }
143
+ :assigns => { :resource_controller_name => "#{file_name.pluralize}" }, :collision => options[:collision]
144
144
  else
145
145
  m.template "layouts/#{RxSettings.layouts.default}.erb",
146
146
  File.join("#{@flex_root}", base_folder, "views", "generated", "#{@class_name}Box.mxml"),
147
- :assigns => { :resource_controller_name => "#{file_name.pluralize}" }
147
+ :assigns => { :resource_controller_name => "#{file_name.pluralize}" }, :collision => options[:collision]
148
148
  end
149
149
 
150
150
  unless options[:skip_fixture]